File:  [local] / rpl / src / rpl.c
Revision 1.136: download - view: text, annotated - select for diffs - revision graph
Thu Mar 21 11:30:31 2013 UTC (11 years, 1 month ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Troisième série de patches pour -Wconversion.

    1: /*
    2: ================================================================================
    3:   RPL/2 (R) version 4.1.13
    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: 
 3408:             (*s_etat_processus).test_instruction = 'N';
 3409:             (*s_etat_processus).nombre_arguments = 0;
 3410:             (*s_etat_processus).affichage_arguments = 'N';
 3411:             (*s_etat_processus).autorisation_conversion_chaine = 'Y';
 3412:             (*s_etat_processus).autorisation_evaluation_nom = 'Y';
 3413: 
 3414:             if (mode_interactif == d_vrai)
 3415:             {
 3416:                 (*s_etat_processus).autorisation_nom_implicite = 'Y';
 3417:             }
 3418:             else
 3419:             {
 3420:                 (*s_etat_processus).autorisation_nom_implicite = 'N';
 3421:             }
 3422: 
 3423:             (*s_etat_processus).autorisation_empilement_programme = 'N';
 3424:             (*s_etat_processus).requete_arret = 'N';
 3425:             (*s_etat_processus).evaluation_forcee = 'N';
 3426:             (*s_etat_processus).recherche_type = 'N';
 3427: 
 3428:             (*s_etat_processus).constante_symbolique = 'N';
 3429:             (*s_etat_processus).traitement_symbolique = 'N';
 3430: 
 3431:             (*s_etat_processus).expression_courante = NULL;
 3432:             (*s_etat_processus).objet_courant = NULL;
 3433:             (*s_etat_processus).evaluation_expression_compilee = 'N';
 3434: 
 3435:             (*s_etat_processus).l_base_pile = NULL;
 3436:             (*s_etat_processus).l_base_pile_last = NULL;
 3437: 
 3438:             (*s_etat_processus).s_arbre_variables = NULL;
 3439:             (*s_etat_processus).l_liste_variables_par_niveau = NULL;
 3440:             (*s_etat_processus).l_liste_variables_statiques = NULL;
 3441:             (*s_etat_processus).gel_liste_variables = d_faux;
 3442:             s_arbre_variables_partagees = NULL;
 3443:             l_liste_variables_partagees = NULL;
 3444:             (*s_etat_processus).s_arbre_variables_partagees =
 3445:                     &s_arbre_variables_partagees;
 3446:             (*s_etat_processus).l_liste_variables_partagees =
 3447:                     &l_liste_variables_partagees;
 3448:             (*s_etat_processus).pointeur_variable_courante = NULL;
 3449:             (*s_etat_processus).pointeur_variable_statique_courante = NULL;
 3450:             (*s_etat_processus).pointeur_variable_partagee_courante = NULL;
 3451:             (*s_etat_processus).niveau_courant = 0;
 3452:             (*s_etat_processus).niveau_initial = 0;
 3453:             (*s_etat_processus).creation_variables_statiques = d_faux;
 3454:             (*s_etat_processus).creation_variables_partagees = d_faux;
 3455: 
 3456:             (*s_etat_processus).s_bibliotheques = NULL;
 3457:             (*s_etat_processus).s_instructions_externes = NULL;
 3458:             (*s_etat_processus).nombre_instructions_externes = 0;
 3459: 
 3460:             (*s_etat_processus).systeme_axes = 0;
 3461: 
 3462:             (*s_etat_processus).x_min = -10.;
 3463:             (*s_etat_processus).x_max = 10.;
 3464:             (*s_etat_processus).y_min = -10.;
 3465:             (*s_etat_processus).y_max = 10.;
 3466:             (*s_etat_processus).z_min = -10.;
 3467:             (*s_etat_processus).z_max = 10.;
 3468: 
 3469:             (*s_etat_processus).x2_min = -10.;
 3470:             (*s_etat_processus).x2_max = 10.;
 3471:             (*s_etat_processus).y2_min = -10.;
 3472:             (*s_etat_processus).y2_max = 10.;
 3473:             (*s_etat_processus).z2_min = -10.;
 3474:             (*s_etat_processus).z2_max = 10.;
 3475: 
 3476:             (*s_etat_processus).resolution = .01;
 3477: 
 3478:             (*s_etat_processus).souris_active = d_faux;
 3479: 
 3480:             (*s_etat_processus).echelle_automatique_x = d_faux;
 3481:             (*s_etat_processus).echelle_automatique_y = d_faux;
 3482:             (*s_etat_processus).echelle_automatique_z = d_faux;
 3483: 
 3484:             (*s_etat_processus).echelle_automatique_x2 = d_faux;
 3485:             (*s_etat_processus).echelle_automatique_y2 = d_faux;
 3486:             (*s_etat_processus).echelle_automatique_z2 = d_faux;
 3487: 
 3488:             (*s_etat_processus).echelle_log_x = d_faux;
 3489:             (*s_etat_processus).echelle_log_y = d_faux;
 3490:             (*s_etat_processus).echelle_log_z = d_faux;
 3491: 
 3492:             (*s_etat_processus).echelle_log_x2 = d_faux;
 3493:             (*s_etat_processus).echelle_log_y2 = d_faux;
 3494:             (*s_etat_processus).echelle_log_z2 = d_faux;
 3495: 
 3496:             (*s_etat_processus).point_de_vue_theta = 4 * atan((real8) 1) / 6;
 3497:             (*s_etat_processus).point_de_vue_phi = 4 * atan((real8) 1) / 3;
 3498:             (*s_etat_processus).echelle_3D = 1;
 3499: 
 3500:             strcpy((*s_etat_processus).type_trace_eq, "FONCTION");
 3501:             strcpy((*s_etat_processus).type_trace_sigma, "POINTS");
 3502:             (*s_etat_processus).fichiers_graphiques = NULL;
 3503:             (*s_etat_processus).nom_fichier_impression = NULL;
 3504:             strcpy((*s_etat_processus).format_papier, "a4paper");
 3505:             (*s_etat_processus).entree_standard = NULL;
 3506:             (*s_etat_processus).s_marques = NULL;
 3507:             (*s_etat_processus).requete_nouveau_plan = d_vrai;
 3508:             (*s_etat_processus).mise_a_jour_trace_requise = d_faux;
 3509: 
 3510:             (*s_etat_processus).l_base_pile = NULL;
 3511:             (*s_etat_processus).hauteur_pile_operationnelle = 0;
 3512:             (*s_etat_processus).l_base_pile_contextes = NULL;
 3513:             (*s_etat_processus).l_base_pile_taille_contextes = NULL;
 3514: 
 3515:             (*s_etat_processus).position_courante = 0;
 3516: 
 3517:             (*s_etat_processus).l_base_pile_systeme = NULL;
 3518:             (*s_etat_processus).hauteur_pile_systeme = 0;
 3519: 
 3520:             (*s_etat_processus).l_base_pile_processus = NULL;
 3521:             (*s_etat_processus).presence_pipes = d_faux;
 3522:             (*s_etat_processus).pipe_donnees = 0;
 3523:             (*s_etat_processus).pipe_acquittement = 0;
 3524:             (*s_etat_processus).pipe_injections = 0;
 3525:             (*s_etat_processus).pipe_nombre_injections = 0;
 3526:             (*s_etat_processus).nombre_objets_injectes = 0;
 3527:             (*s_etat_processus).nombre_objets_envoyes_non_lus = 0;
 3528:             (*s_etat_processus).pourcentage_maximal_cpu = 100;
 3529:             (*s_etat_processus).temps_maximal_cpu = 0;
 3530:             (*s_etat_processus).thread_fusible = 0;
 3531:             (*s_etat_processus).presence_fusible = d_faux;
 3532: 
 3533:             (*s_etat_processus).niveau_recursivite = 0;
 3534:             (*s_etat_processus).generateur_aleatoire = NULL;
 3535:             (*s_etat_processus).type_generateur_aleatoire = NULL;
 3536: 
 3537:             (*s_etat_processus).colonne_statistique_1 = 1; 
 3538:             (*s_etat_processus).colonne_statistique_2 = 2; 
 3539: 
 3540:             (*s_etat_processus).debug_programme = d_faux;
 3541:             (*s_etat_processus).execution_pas_suivant = d_faux;
 3542:             (*s_etat_processus).traitement_instruction_halt = d_faux;
 3543: 
 3544:             (*s_etat_processus).derniere_exception = d_ep;
 3545:             (*s_etat_processus).derniere_erreur_systeme = d_es;
 3546:             (*s_etat_processus).derniere_erreur_execution = d_ex;
 3547:             (*s_etat_processus).derniere_erreur_evaluation = d_ex;
 3548:             (*s_etat_processus).derniere_erreur_fonction_externe = 0;
 3549: 
 3550:             (*s_etat_processus).erreur_processus_fils = d_faux;
 3551:             (*s_etat_processus).erreur_systeme_processus_fils = d_es;
 3552:             (*s_etat_processus).erreur_execution_processus_fils = d_ex;
 3553:             (*s_etat_processus).pid_erreur_processus_fils = 0;
 3554:             (*s_etat_processus).exception_processus_fils = d_ep;
 3555:             (*s_etat_processus).core = core;
 3556:             (*s_etat_processus).invalidation_message_erreur = d_faux;
 3557:             (*s_etat_processus).s_objet_errone = NULL;
 3558:             (*s_etat_processus).s_objet_erreur = NULL;
 3559: 
 3560:             (*s_etat_processus).retour_routine_evaluation = 'N';
 3561: 
 3562:             (*s_etat_processus).traitement_interruption = 'N';
 3563:             (*s_etat_processus).traitement_interruptible = 'Y';
 3564:             (*s_etat_processus).nombre_interruptions_en_queue = 0;
 3565:             (*s_etat_processus).nombre_interruptions_non_affectees = 0;
 3566: 
 3567:             for(i = 0; i < d_NOMBRE_INTERRUPTIONS; i++)
 3568:             {
 3569:                 (*s_etat_processus).masque_interruptions[i] = 'N';
 3570:                 (*s_etat_processus).queue_interruptions[i] = 0;
 3571:                 (*s_etat_processus).corps_interruptions[i] = NULL;
 3572:                 (*s_etat_processus).pile_origine_interruptions[i] = NULL;
 3573:             }
 3574: 
 3575:             (*s_etat_processus).at_exit = NULL;
 3576:             (*s_etat_processus).at_poke = NULL;
 3577:             (*s_etat_processus).traitement_at_poke = 'N';
 3578: 
 3579:             (*s_etat_processus).pointeurs_caracteres = NULL;
 3580:             (*s_etat_processus).arbre_instructions = NULL;
 3581: 
 3582:             (*s_etat_processus).tid_processus_pere = pthread_self();
 3583:             (*s_etat_processus).tid = pthread_self();
 3584:             (*s_etat_processus).pid_processus_pere = getpid();
 3585:             (*s_etat_processus).processus_detache = d_vrai;
 3586:             (*s_etat_processus).var_volatile_processus_pere = -1;
 3587:             (*s_etat_processus).var_volatile_processus_racine = -1;
 3588:             (*s_etat_processus).var_volatile_traitement_retarde_stop = 0;
 3589:             (*s_etat_processus).var_volatile_alarme = 0;
 3590:             (*s_etat_processus).var_volatile_requete_arret = 0;
 3591:             (*s_etat_processus).var_volatile_requete_arret2 = 0;
 3592:             (*s_etat_processus).var_volatile_traitement_retarde_stop = 0;
 3593:             (*s_etat_processus).var_volatile_traitement_sigint = 0;
 3594:             (*s_etat_processus).var_volatile_recursivite = 0;
 3595:             (*s_etat_processus).var_volatile_exception_gsl = 0;
 3596:             (*s_etat_processus).arret_depuis_abort = 0;
 3597:             (*s_etat_processus).pointeur_signal_lecture = 0;
 3598:             (*s_etat_processus).pointeur_signal_ecriture = 0;
 3599: 
 3600:             initialisation_allocateur(s_etat_processus);
 3601:             initialisation_drapeaux(s_etat_processus);
 3602:             initialisation_variables(s_etat_processus);
 3603:             initialisation_instructions(s_etat_processus);
 3604: 
 3605:             if ((*s_etat_processus).erreur_systeme != d_es)
 3606:             {
 3607: #               ifndef SEMAPHORES_NOMMES
 3608:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3609:                     sem_post(&semaphore_gestionnaires_signaux);
 3610:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3611:                     sem_destroy(&((*s_etat_processus).semaphore_fork));
 3612: #               else
 3613:                     sem_post((*s_etat_processus).semaphore_fork);
 3614:                     sem_post(semaphore_gestionnaires_signaux);
 3615:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3616:                             getpid(), SEM_SIGNAUX);
 3617:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3618:                             getpid(), pthread_self(), SEM_FORK);
 3619: #               endif
 3620: 
 3621:                 liberation_contexte_cas(s_etat_processus);
 3622:                 liberation_queue_signaux(s_etat_processus);
 3623: 
 3624: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3625:                     stackoverflow_deinstall_handler();
 3626: #               endif
 3627: 
 3628: #               ifdef HAVE_SIGSEGV_RECOVERY
 3629:                     if (debug == d_faux)
 3630:                     {
 3631:                         sigsegv_deinstall_handler();
 3632:                     }
 3633: #               endif
 3634: 
 3635:                 if ((*s_etat_processus).langue == 'F')
 3636:                 {
 3637:                     printf("+++Système : Mémoire insuffisante\n");
 3638:                 }
 3639:                 else
 3640:                 {
 3641:                     printf("+++System : Not enough memory\n");
 3642:                 }
 3643: 
 3644:                 return(EXIT_FAILURE);
 3645:             }
 3646: 
 3647:             if (((*s_etat_processus).instruction_derniere_erreur =
 3648:                     malloc(sizeof(unsigned char))) == NULL)
 3649:             {
 3650: #               ifndef SEMAPHORES_NOMMES
 3651:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3652:                     sem_post(&semaphore_gestionnaires_signaux);
 3653:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3654:                     sem_destroy(&((*s_etat_processus).semaphore_fork));
 3655: #               else
 3656:                     sem_post((*s_etat_processus).semaphore_fork);
 3657:                     sem_post(semaphore_gestionnaires_signaux);
 3658:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3659:                             getpid(), SEM_SIGNAUX);
 3660:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3661:                             getpid(), pthread_self(), SEM_FORK);
 3662: #               endif
 3663: 
 3664:                 liberation_contexte_cas(s_etat_processus);
 3665:                 liberation_queue_signaux(s_etat_processus);
 3666: 
 3667: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3668:                     stackoverflow_deinstall_handler();
 3669: #               endif
 3670: 
 3671: #               ifdef HAVE_SIGSEGV_RECOVERY
 3672:                     if (debug == d_faux)
 3673:                     {
 3674:                         sigsegv_deinstall_handler();
 3675:                     }
 3676: #               endif
 3677: 
 3678:                 erreur = d_es_allocation_memoire;
 3679: 
 3680:                 if ((*s_etat_processus).langue == 'F')
 3681:                 {
 3682:                     printf("+++Système : Mémoire insuffisante\n");
 3683:                 }
 3684:                 else
 3685:                 {
 3686:                     printf("+++System : Not enough memory\n");
 3687:                 }
 3688: 
 3689:                 return(EXIT_FAILURE);
 3690:             }
 3691: 
 3692:             strcpy((*s_etat_processus).instruction_derniere_erreur, "");
 3693:             (*s_etat_processus).niveau_derniere_erreur = 0;
 3694: 
 3695:             if (traitement_fichier_temporaire == 'Y')
 3696:             {
 3697:                 (*s_etat_processus).mode_interactif = 'Y';
 3698:             }
 3699:             else
 3700:             {
 3701:                 (*s_etat_processus).mode_interactif = 'N';
 3702:             }
 3703: 
 3704:             if (((*s_etat_processus).instruction_courante = (unsigned char *)
 3705:                     malloc(sizeof(unsigned char))) == NULL)
 3706:             {
 3707: #               ifndef SEMAPHORES_NOMMES
 3708:                     sem_post(&((*s_etat_processus).semaphore_fork));
 3709:                     sem_post(&semaphore_gestionnaires_signaux);
 3710:                     sem_destroy(&semaphore_gestionnaires_signaux);
 3711:                     sem_destroy(&((*s_etat_processus).semaphore_fork));
 3712: #               else
 3713:                     sem_post((*s_etat_processus).semaphore_fork);
 3714:                     sem_post(semaphore_gestionnaires_signaux);
 3715:                     sem_destroy2(semaphore_gestionnaires_signaux,
 3716:                             getpid(), SEM_SIGNAUX);
 3717:                     sem_destroy3((*s_etat_processus).semphore_fork,
 3718:                             getpid(), pthread_self(), SEM_FORK);
 3719: #               endif
 3720: 
 3721:                 liberation_contexte_cas(s_etat_processus);
 3722:                 liberation_queue_signaux(s_etat_processus);
 3723: 
 3724: #               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3725:                     stackoverflow_deinstall_handler();
 3726: #               endif
 3727: 
 3728: #               ifdef HAVE_SIGSEGV_RECOVERY
 3729:                     if (debug == d_faux)
 3730:                     {
 3731:                         sigsegv_deinstall_handler();
 3732:                     }
 3733: #               endif
 3734: 
 3735:                 erreur = d_es_allocation_memoire;
 3736: 
 3737:                 if ((*s_etat_processus).langue == 'F')
 3738:                 {
 3739:                     printf("+++Système : Mémoire insuffisante\n");
 3740:                 }
 3741:                 else
 3742:                 {
 3743:                     printf("+++System : Not enough memory\n");
 3744:                 }
 3745: 
 3746:                 return(EXIT_FAILURE);
 3747:             }
 3748: 
 3749:             (*s_etat_processus).instruction_courante[0] = d_code_fin_chaine;
 3750: 
 3751:             empilement_pile_systeme(s_etat_processus);
 3752: 
 3753:             free((*s_etat_processus).instruction_courante);
 3754: 
 3755:             if ((*s_etat_processus).erreur_systeme != d_es)
 3756:             {
 3757:                 erreur = d_es_allocation_memoire;
 3758:             }
 3759:             else
 3760:             {
 3761:                 (*((*s_etat_processus).l_base_pile_systeme))
 3762:                         .retour_definition = 'Y';
 3763: 
 3764:                 (*s_etat_processus).indep = allocation(s_etat_processus, NON);
 3765:                 (*s_etat_processus).depend = allocation(s_etat_processus, NON);
 3766:                 (*s_etat_processus).parametres_courbes_de_niveau =
 3767:                         allocation(s_etat_processus, NON);
 3768: 
 3769:                 if (((*s_etat_processus).indep != NULL) &&
 3770:                         ((*s_etat_processus).depend != NULL) &&
 3771:                         ((*s_etat_processus).parametres_courbes_de_niveau
 3772:                         != NULL))
 3773:                 {
 3774:                     (*((*s_etat_processus).indep)).type = NOM;
 3775:                     (*((*s_etat_processus).depend)).type = NOM;
 3776:                     (*((*s_etat_processus).
 3777:                             parametres_courbes_de_niveau)).type = LST;
 3778: 
 3779:                     initialisation_objet((*s_etat_processus).indep);
 3780:                     initialisation_objet((*s_etat_processus).depend);
 3781:                     initialisation_objet((*s_etat_processus)
 3782:                             .parametres_courbes_de_niveau);
 3783: 
 3784:                     (*((*s_etat_processus).indep)).objet = (struct_nom *)
 3785:                             malloc(sizeof(struct_nom));
 3786:                     (*((*s_etat_processus).depend)).objet = (struct_nom *)
 3787:                             malloc(sizeof(struct_nom));
 3788:                     (*((*s_etat_processus).parametres_courbes_de_niveau))
 3789:                             .objet = (struct_liste_chainee *)
 3790:                             malloc(sizeof(struct_liste_chainee));
 3791: 
 3792:                     if (((*((*s_etat_processus).depend)).objet == NULL) ||
 3793:                             ((*((*s_etat_processus).depend)).objet == NULL) ||
 3794:                             ((*((*s_etat_processus).
 3795:                             parametres_courbes_de_niveau)).objet == NULL))
 3796:                     {
 3797: #                       ifndef SEMAPHORES_NOMMES
 3798:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3799:                             sem_post(&semaphore_gestionnaires_signaux);
 3800:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3801:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3802: #                       else
 3803:                             sem_post((*s_etat_processus).semaphore_fork);
 3804:                             sem_post(semaphore_gestionnaires_signaux);
 3805:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3806:                                     getpid(), SEM_SIGNAUX);
 3807:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3808:                                     getpid(), pthread_self(), SEM_FORK);
 3809: #                       endif
 3810: 
 3811:                         liberation_contexte_cas(s_etat_processus);
 3812:                         liberation_queue_signaux(s_etat_processus);
 3813: 
 3814: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3815:                             stackoverflow_deinstall_handler();
 3816: #                       endif
 3817: 
 3818: #                       ifdef HAVE_SIGSEGV_RECOVERY
 3819:                             if (debug == d_faux)
 3820:                             {
 3821:                                 sigsegv_deinstall_handler();
 3822:                             }
 3823: #                       endif
 3824: 
 3825:                         erreur = d_es_allocation_memoire;
 3826:                         
 3827:                         if ((*s_etat_processus).langue == 'F')
 3828:                         {
 3829:                             printf("+++Système : Mémoire insuffisante\n");
 3830:                         }
 3831:                         else
 3832:                         {
 3833:                             printf("+++System : Not enough memory\n");
 3834:                         }
 3835: 
 3836:                         return(EXIT_FAILURE);
 3837:                     }
 3838: 
 3839:                     (*((struct_nom *) (*((*s_etat_processus).indep)).objet))
 3840:                             .nom = malloc(2 * sizeof(unsigned char));
 3841:                     (*((struct_nom *) (*((*s_etat_processus).depend)).objet))
 3842:                             .nom = malloc(2 * sizeof(unsigned char));
 3843: 
 3844:                     if (((*((struct_nom *) (*((*s_etat_processus).indep))
 3845:                             .objet)).nom == NULL) || ((*((struct_nom *)
 3846:                             (*((*s_etat_processus).depend)).objet)).nom ==
 3847:                             NULL))
 3848:                     {
 3849: #                       ifndef SEMAPHORES_NOMMES
 3850:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3851:                             sem_post(&semaphore_gestionnaires_signaux);
 3852:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3853:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3854: #                       else
 3855:                             sem_post((*s_etat_processus).semaphore_fork);
 3856:                             sem_post(semaphore_gestionnaires_signaux);
 3857:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3858:                                     getpid(), SEM_SIGNAUX);
 3859:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3860:                                     getpid(), pthread_self(), SEM_FORK);
 3861: #                       endif
 3862: 
 3863:                         liberation_contexte_cas(s_etat_processus);
 3864:                         liberation_queue_signaux(s_etat_processus);
 3865: 
 3866: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3867:                             stackoverflow_deinstall_handler();
 3868: #                       endif
 3869: 
 3870: #                       ifdef HAVE_SIGSEGV_RECOVERY
 3871:                             if (debug == d_faux)
 3872:                             {
 3873:                                 sigsegv_deinstall_handler();
 3874:                             }
 3875: #                       endif
 3876: 
 3877:                         erreur = d_es_allocation_memoire;
 3878: 
 3879:                         if ((*s_etat_processus).langue == 'F')
 3880:                         {
 3881:                             printf("+++Système : Mémoire insuffisante\n");
 3882:                         }
 3883:                         else
 3884:                         {
 3885:                             printf("+++System : Not enough memory\n");
 3886:                         }
 3887: 
 3888:                         return(EXIT_FAILURE);
 3889:                     }
 3890: 
 3891:                     strcpy((*((struct_nom *) (*((*s_etat_processus).indep))
 3892:                             .objet)).nom, "X");
 3893:                     strcpy((*((struct_nom *) (*((*s_etat_processus).depend))
 3894:                             .objet)).nom, "Y");
 3895: 
 3896:                     (*((struct_nom *) (*((*s_etat_processus).indep))
 3897:                             .objet)).symbole = d_vrai;
 3898:                     (*((struct_nom *) (*((*s_etat_processus).depend))
 3899:                             .objet)).symbole = d_vrai;
 3900: 
 3901:                     (*((struct_liste_chainee *) (*((*s_etat_processus)
 3902:                             .parametres_courbes_de_niveau)).objet)).suivant
 3903:                             = NULL;
 3904: 
 3905:                     (*((struct_liste_chainee *) (*((*s_etat_processus)
 3906:                             .parametres_courbes_de_niveau)).objet)).donnee
 3907:                             = malloc(sizeof(struct_objet));
 3908: 
 3909:                     (*s_etat_processus).legende =
 3910:                             malloc(sizeof(unsigned char));
 3911:                     (*s_etat_processus).label_x =
 3912:                             malloc(sizeof(unsigned char));
 3913:                     (*s_etat_processus).label_y =
 3914:                             malloc(sizeof(unsigned char));
 3915:                     (*s_etat_processus).label_z =
 3916:                             malloc(sizeof(unsigned char));
 3917:                     (*s_etat_processus).titre =
 3918:                             malloc(sizeof(unsigned char));
 3919: 
 3920:                     if (((*s_etat_processus).label_x == NULL) ||
 3921:                             ((*s_etat_processus).label_y == NULL) ||
 3922:                             ((*s_etat_processus).label_z == NULL) ||
 3923:                             ((*s_etat_processus).titre == NULL) ||
 3924:                             ((*s_etat_processus).legende == NULL) ||
 3925:                             ((*((struct_liste_chainee *) (*((*s_etat_processus)
 3926:                             .parametres_courbes_de_niveau)).objet)).donnee
 3927:                             == NULL))
 3928:                     {
 3929: #                       ifndef SEMAPHORES_NOMMES
 3930:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3931:                             sem_post(&semaphore_gestionnaires_signaux);
 3932:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3933:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3934: #                       else
 3935:                             sem_post((*s_etat_processus).semaphore_fork);
 3936:                             sem_post(semaphore_gestionnaires_signaux);
 3937:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3938:                                     getpid(), SEM_SIGNAUX);
 3939:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3940:                                     getpid(), pthread_self(), SEM_FORK);
 3941: #                       endif
 3942: 
 3943:                         liberation_contexte_cas(s_etat_processus);
 3944:                         liberation_queue_signaux(s_etat_processus);
 3945: 
 3946: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 3947:                             stackoverflow_deinstall_handler();
 3948: #                       endif
 3949: 
 3950: #                       ifdef HAVE_SIGSEGV_RECOVERY
 3951:                             if (debug == d_faux)
 3952:                             {
 3953:                                 sigsegv_deinstall_handler();
 3954:                             }
 3955: #                       endif
 3956: 
 3957:                         erreur = d_es_allocation_memoire;
 3958: 
 3959:                         if ((*s_etat_processus).langue == 'F')
 3960:                         {
 3961:                             printf("+++Système : Mémoire insuffisante\n");
 3962:                         }
 3963:                         else
 3964:                         {
 3965:                             printf("+++System : Not enough memory\n");
 3966:                         }
 3967: 
 3968:                         return(EXIT_FAILURE);
 3969:                     }
 3970: 
 3971:                     (*(*((struct_liste_chainee *) (*((*s_etat_processus)
 3972:                             .parametres_courbes_de_niveau)).objet)).donnee)
 3973:                             .type = CHN;
 3974: 
 3975:                     initialisation_objet((*((struct_liste_chainee *)
 3976:                             (*((*s_etat_processus)
 3977:                             .parametres_courbes_de_niveau))
 3978:                             .objet)).donnee);
 3979: 
 3980:                     if (((*(*((struct_liste_chainee *) (*((*s_etat_processus)
 3981:                             .parametres_courbes_de_niveau)).objet)).donnee)
 3982:                             .objet = malloc(10 * sizeof(unsigned char)))
 3983:                             == NULL)
 3984:                     {
 3985: #                       ifndef SEMAPHORES_NOMMES
 3986:                             sem_post(&((*s_etat_processus).semaphore_fork));
 3987:                             sem_post(&semaphore_gestionnaires_signaux);
 3988:                             sem_destroy(&semaphore_gestionnaires_signaux);
 3989:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 3990: #                       else
 3991:                             sem_post((*s_etat_processus).semaphore_fork);
 3992:                             sem_post(semaphore_gestionnaires_signaux);
 3993:                             sem_destroy2(semaphore_gestionnaires_signaux,
 3994:                                     getpid(), SEM_SIGNAUX);
 3995:                             sem_destroy3((*s_etat_processus).semphore_fork,
 3996:                                     getpid(), pthread_self(), SEM_FORK);
 3997: #                       endif
 3998: 
 3999:                         liberation_contexte_cas(s_etat_processus);
 4000:                         liberation_queue_signaux(s_etat_processus);
 4001: 
 4002: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4003:                             stackoverflow_deinstall_handler();
 4004: #                       endif
 4005: 
 4006: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4007:                             if (debug == d_faux)
 4008:                             {
 4009:                                 sigsegv_deinstall_handler();
 4010:                             }
 4011: #                       endif
 4012: 
 4013:                         erreur = d_es_allocation_memoire;
 4014: 
 4015:                         if ((*s_etat_processus).langue == 'F')
 4016:                         {
 4017:                             printf("+++Système : Mémoire insuffisante\n");
 4018:                         }
 4019:                         else
 4020:                         {
 4021:                             printf("+++System : Not enough memory\n");
 4022:                         }
 4023: 
 4024:                         return(EXIT_FAILURE);
 4025:                     }
 4026: 
 4027:                     strcpy((unsigned char *) (*(*((struct_liste_chainee *)
 4028:                             (*((*s_etat_processus)
 4029:                             .parametres_courbes_de_niveau))
 4030:                             .objet)).donnee).objet, "AUTOMATIC");
 4031: 
 4032:                     (*s_etat_processus).label_x[0] = d_code_fin_chaine;
 4033:                     (*s_etat_processus).label_y[0] = d_code_fin_chaine;
 4034:                     (*s_etat_processus).label_z[0] = d_code_fin_chaine;
 4035:                     (*s_etat_processus).titre[0] = d_code_fin_chaine;
 4036:                     (*s_etat_processus).legende[0] = d_code_fin_chaine;
 4037: 
 4038:                     (*s_etat_processus).nom_fichier_gnuplot = NULL;
 4039:                     (*s_etat_processus).type_fichier_gnuplot = NULL;
 4040: 
 4041:                     (*s_etat_processus).x_tics = 0;
 4042:                     (*s_etat_processus).y_tics = 0;
 4043:                     (*s_etat_processus).z_tics = 0;
 4044: 
 4045:                     (*s_etat_processus).x_lines = d_vrai;
 4046:                     (*s_etat_processus).y_lines = d_vrai;
 4047:                     (*s_etat_processus).z_lines = d_vrai;
 4048: 
 4049:                     (*s_etat_processus).mx_tics = -1;
 4050:                     (*s_etat_processus).my_tics = -1;
 4051:                     (*s_etat_processus).mz_tics = -1;
 4052: 
 4053:                     (*s_etat_processus).mx_lines = d_faux;
 4054:                     (*s_etat_processus).my_lines = d_faux;
 4055:                     (*s_etat_processus).mz_lines = d_faux;
 4056: 
 4057:                     (*s_etat_processus).x2_tics = -1;
 4058:                     (*s_etat_processus).y2_tics = -1;
 4059:                     (*s_etat_processus).z2_tics = -1;
 4060: 
 4061:                     (*s_etat_processus).x2_lines = d_faux;
 4062:                     (*s_etat_processus).y2_lines = d_faux;
 4063:                     (*s_etat_processus).z2_lines = d_faux;
 4064: 
 4065:                     (*s_etat_processus).mx2_tics = -1;
 4066:                     (*s_etat_processus).my2_tics = -1;
 4067:                     (*s_etat_processus).mz2_tics = -1;
 4068: 
 4069:                     (*s_etat_processus).mx2_lines = d_faux;
 4070:                     (*s_etat_processus).my2_lines = d_faux;
 4071:                     (*s_etat_processus).mz2_lines = d_faux;
 4072: 
 4073:                     (*s_etat_processus).mode_evaluation_expression = 'N';
 4074:                     (*s_etat_processus).mode_execution_programme = 'Y';
 4075: 
 4076:                     if ((*s_etat_processus).definitions_chainees == NULL)
 4077:                     {
 4078:                         if ((erreur = chainage(s_etat_processus)) !=
 4079:                                 d_absence_erreur)
 4080:                         {
 4081: #                           ifndef SEMAPHORES_NOMMES
 4082:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4083:                                 sem_post(&semaphore_gestionnaires_signaux);
 4084:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4085:                                 sem_destroy(&((*s_etat_processus)
 4086:                                         .semaphore_fork));
 4087: #                           else
 4088:                                 sem_post((*s_etat_processus).semaphore_fork);
 4089:                                 sem_post(semaphore_gestionnaires_signaux);
 4090:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4091:                                         getpid(), SEM_SIGNAUX);
 4092:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4093:                                         getpid(), pthread_self(), SEM_FORK);
 4094: #                           endif
 4095: 
 4096:                             liberation_contexte_cas(s_etat_processus);
 4097:                             liberation_queue_signaux(s_etat_processus);
 4098: 
 4099: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4100:                                 stackoverflow_deinstall_handler();
 4101: #                           endif
 4102: 
 4103: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4104:                                 if (debug == d_faux)
 4105:                                 {
 4106:                                     sigsegv_deinstall_handler();
 4107:                                 }
 4108: #                           endif
 4109: 
 4110:                             if ((*s_etat_processus).langue == 'F')
 4111:                             {
 4112:                                 printf("+++Fatal :"
 4113:                                         " Chaînage des définitions"
 4114:                                         " impossible\n");
 4115:                             }
 4116:                             else
 4117:                             {
 4118:                                 printf("+++Fatal : Error in "
 4119:                                         "compilation\n");
 4120:                             }
 4121: 
 4122:                             if (traitement_fichier_temporaire == 'Y')
 4123:                             {
 4124:                                 if (destruction_fichier(
 4125:                                         nom_fichier_temporaire)
 4126:                                         == d_erreur)
 4127:                                 {
 4128:                                     return(EXIT_FAILURE);
 4129:                                 }
 4130: 
 4131:                                 free(nom_fichier_temporaire);
 4132:                             }
 4133: 
 4134:                             return(EXIT_FAILURE);
 4135:                         }
 4136:                     }
 4137: 
 4138:                     if ((erreur = compilation(s_etat_processus)) !=
 4139:                             d_absence_erreur)
 4140:                     {
 4141: #                       ifndef SEMAPHORES_NOMMES
 4142:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4143:                             sem_post(&semaphore_gestionnaires_signaux);
 4144:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4145:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4146: #                       else
 4147:                             sem_post((*s_etat_processus).semaphore_fork);
 4148:                             sem_post(semaphore_gestionnaires_signaux);
 4149:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4150:                                     getpid(), SEM_SIGNAUX);
 4151:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4152:                                     getpid(), pthread_self(), SEM_FORK);
 4153: #                       endif
 4154: 
 4155:                         liberation_contexte_cas(s_etat_processus);
 4156:                         liberation_queue_signaux(s_etat_processus);
 4157: 
 4158: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4159:                             stackoverflow_deinstall_handler();
 4160: #                       endif
 4161: 
 4162: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4163:                             if (debug == d_faux)
 4164:                             {
 4165:                                 sigsegv_deinstall_handler();
 4166:                             }
 4167: #                       endif
 4168: 
 4169:                         if (traitement_fichier_temporaire == 'Y')
 4170:                         {
 4171:                             if (destruction_fichier(nom_fichier_temporaire)
 4172:                                     == d_erreur)
 4173:                             {
 4174:                                 return(EXIT_FAILURE);
 4175:                             }
 4176: 
 4177:                             free(nom_fichier_temporaire);
 4178:                         }
 4179: 
 4180:                         printf("%s [%d]\n", message =
 4181:                                 messages(s_etat_processus), (int) getpid());
 4182:                         free(message);
 4183: 
 4184:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4185:                         {
 4186:                             printf("%s", ds_beep);
 4187:                         }
 4188: 
 4189:                         if ((*s_etat_processus).core == d_vrai)
 4190:                         {
 4191:                             printf("\n");
 4192:                             
 4193:                             if ((*s_etat_processus).langue == 'F')
 4194:                             {
 4195:                                 printf("+++Information : Génération du fichier "
 4196:                                         "rpl-core [%d]\n", (int) getpid());
 4197:                             }
 4198:                             else
 4199:                             {
 4200:                                 printf("+++Information : Writing rpl-core "
 4201:                                         "file [%d]\n", (int) getpid());
 4202:                             }
 4203: 
 4204:                             rplcore(s_etat_processus);
 4205: 
 4206:                             if ((*s_etat_processus).langue == 'F')
 4207:                             {
 4208:                                 printf("+++Information : Processus tracé "
 4209:                                         "[%d]\n", (int) getpid());
 4210:                             }
 4211:                             else
 4212:                             {
 4213:                                 printf("+++Information : Done [%d]\n",
 4214:                                         (int) getpid());
 4215:                             }
 4216: 
 4217:                             printf("\n");
 4218:                         }
 4219: 
 4220:                         return(EXIT_FAILURE);
 4221:                     }
 4222: 
 4223:                     (*s_etat_processus).position_courante = 0;
 4224:                     (*s_etat_processus).traitement_cycle_exit = 'N';
 4225: 
 4226:                     if ((*s_etat_processus).s_arbre_variables == NULL)
 4227:                     {
 4228: #                       ifndef SEMAPHORES_NOMMES
 4229:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4230:                             sem_post(&semaphore_gestionnaires_signaux);
 4231:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4232:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4233: #                       else
 4234:                             sem_post((*s_etat_processus).semaphore_fork);
 4235:                             sem_post(semaphore_gestionnaires_signaux);
 4236:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4237:                                     getpid(), SEM_SIGNAUX);
 4238:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4239:                                     getpid(), pthread_self(), SEM_FORK);
 4240: #                       endif
 4241: 
 4242:                         liberation_contexte_cas(s_etat_processus);
 4243:                         liberation_queue_signaux(s_etat_processus);
 4244: 
 4245: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4246:                             stackoverflow_deinstall_handler();
 4247: #                       endif
 4248: 
 4249: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4250:                             if (debug == d_faux)
 4251:                             {
 4252:                                 sigsegv_deinstall_handler();
 4253:                             }
 4254: #                       endif
 4255: 
 4256:                         if ((*s_etat_processus).langue == 'F')
 4257:                         {
 4258:                             printf("+++Fatal : Aucun point d'entrée\n");
 4259:                         }
 4260:                         else
 4261:                         {
 4262:                             printf("+++Fatal : Any entry point\n");
 4263:                         }
 4264: 
 4265:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4266:                         {
 4267:                             printf("%s", ds_beep);
 4268:                         }
 4269: 
 4270:                         return(EXIT_FAILURE);
 4271:                     }
 4272: 
 4273:                     if (recherche_instruction_suivante(s_etat_processus)
 4274:                             == d_erreur)
 4275:                     {
 4276: #                       ifndef SEMAPHORES_NOMMES
 4277:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4278:                             sem_post(&semaphore_gestionnaires_signaux);
 4279:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4280:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4281: #                       else
 4282:                             sem_post((*s_etat_processus).semaphore_fork);
 4283:                             sem_post(semaphore_gestionnaires_signaux);
 4284:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4285:                                     getpid(), SEM_SIGNAUX);
 4286:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4287:                                     getpid(), pthread_self(), SEM_FORK);
 4288: #                       endif
 4289: 
 4290:                         liberation_contexte_cas(s_etat_processus);
 4291:                         liberation_queue_signaux(s_etat_processus);
 4292: 
 4293: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4294:                             stackoverflow_deinstall_handler();
 4295: #                       endif
 4296: 
 4297: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4298:                             if (debug == d_faux)
 4299:                             {
 4300:                                 sigsegv_deinstall_handler();
 4301:                             }
 4302: #                       endif
 4303: 
 4304:                         if ((*s_etat_processus).langue == 'F')
 4305:                         {
 4306:                             printf("+++Fatal : Aucun point d'entrée\n");
 4307:                         }
 4308:                         else
 4309:                         {
 4310:                             printf("+++Fatal : Any entry point\n");
 4311:                         }
 4312: 
 4313:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4314:                         {
 4315:                             printf("%s", ds_beep);
 4316:                         }
 4317: 
 4318:                         return(EXIT_FAILURE);
 4319:                     }
 4320: 
 4321:                     if (recherche_variable(s_etat_processus,
 4322:                             (*s_etat_processus)
 4323:                             .instruction_courante) == d_faux)
 4324:                     {
 4325: #                       ifndef SEMAPHORES_NOMMES
 4326:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4327:                             sem_post(&semaphore_gestionnaires_signaux);
 4328:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4329:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4330: #                       else
 4331:                             sem_post((*s_etat_processus).semaphore_fork);
 4332:                             sem_post(semaphore_gestionnaires_signaux);
 4333:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4334:                                     getpid(), SEM_SIGNAUX);
 4335:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4336:                                     getpid(), pthread_self(), SEM_FORK);
 4337: #                       endif
 4338: 
 4339:                         liberation_contexte_cas(s_etat_processus);
 4340:                         liberation_queue_signaux(s_etat_processus);
 4341: 
 4342: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4343:                             stackoverflow_deinstall_handler();
 4344: #                       endif
 4345: 
 4346: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4347:                             if (debug == d_faux)
 4348:                             {
 4349:                                 sigsegv_deinstall_handler();
 4350:                             }
 4351: #                       endif
 4352: 
 4353:                         if ((*s_etat_processus).langue == 'F')
 4354:                         {
 4355:                             printf("+++Fatal : Aucun point d'entrée\n");
 4356:                         }
 4357:                         else
 4358:                         {
 4359:                             printf("+++Fatal : Any entry point\n");
 4360:                         }
 4361: 
 4362:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4363:                         {
 4364:                             printf("%s", ds_beep);
 4365:                         }
 4366: 
 4367:                         return(EXIT_FAILURE);
 4368:                     }
 4369: 
 4370:                     if ((*(*s_etat_processus).pointeur_variable_courante)
 4371:                             .niveau != 0)
 4372:                     {
 4373: #                       ifndef SEMAPHORES_NOMMES
 4374:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4375:                             sem_post(&semaphore_gestionnaires_signaux);
 4376:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4377:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4378: #                       else
 4379:                             sem_post((*s_etat_processus).semaphore_fork);
 4380:                             sem_post(semaphore_gestionnaires_signaux);
 4381:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4382:                                     getpid(), SEM_SIGNAUX);
 4383:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4384:                                     getpid(), pthread_self(), SEM_FORK);
 4385: #                       endif
 4386: 
 4387:                         liberation_contexte_cas(s_etat_processus);
 4388:                         liberation_queue_signaux(s_etat_processus);
 4389: 
 4390: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4391:                             stackoverflow_deinstall_handler();
 4392: #                       endif
 4393: 
 4394: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4395:                             if (debug == d_faux)
 4396:                             {
 4397:                                 sigsegv_deinstall_handler();
 4398:                             }
 4399: #                       endif
 4400: 
 4401:                         if ((*s_etat_processus).langue == 'F')
 4402:                         {
 4403:                             printf("+++Fatal : Aucun point d'entrée\n");
 4404:                         }
 4405:                         else
 4406:                         {
 4407:                             printf("+++Fatal : Any entry point\n");
 4408:                         }
 4409: 
 4410:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 4411:                         {
 4412:                             printf("%s", ds_beep);
 4413:                         }
 4414: 
 4415:                         return(EXIT_FAILURE);
 4416:                     }
 4417: 
 4418:                     free((*s_etat_processus).instruction_courante);
 4419:                     (*s_etat_processus).position_courante = 0;
 4420: 
 4421:                     if (((*s_etat_processus).nom_fichier_historique =
 4422:                             malloc((strlen(home) +
 4423:                             strlen(ds_fichier_historique) + 2) *
 4424:                             sizeof(unsigned char))) == NULL)
 4425:                     {
 4426: #                       ifndef SEMAPHORES_NOMMES
 4427:                             sem_post(&((*s_etat_processus).semaphore_fork));
 4428:                             sem_post(&semaphore_gestionnaires_signaux);
 4429:                             sem_destroy(&semaphore_gestionnaires_signaux);
 4430:                             sem_destroy(&((*s_etat_processus).semaphore_fork));
 4431: #                       else
 4432:                             sem_post((*s_etat_processus).semaphore_fork);
 4433:                             sem_post(semaphore_gestionnaires_signaux);
 4434:                             sem_destroy2(semaphore_gestionnaires_signaux,
 4435:                                     getpid(), SEM_SIGNAUX);
 4436:                             sem_destroy3((*s_etat_processus).semphore_fork,
 4437:                                     getpid(), pthread_self(), SEM_FORK);
 4438: #                       endif
 4439: 
 4440:                         liberation_contexte_cas(s_etat_processus);
 4441:                         liberation_queue_signaux(s_etat_processus);
 4442: 
 4443: #                       ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4444:                             stackoverflow_deinstall_handler();
 4445: #                       endif
 4446: 
 4447: #                       ifdef HAVE_SIGSEGV_RECOVERY
 4448:                             if (debug == d_faux)
 4449:                             {
 4450:                                 sigsegv_deinstall_handler();
 4451:                             }
 4452: #                       endif
 4453: 
 4454:                         erreur = d_es_allocation_memoire;
 4455: 
 4456:                         if ((*s_etat_processus).langue == 'F')
 4457:                         {
 4458:                             printf("+++Système : Mémoire insuffisante\n");
 4459:                         }
 4460:                         else
 4461:                         {
 4462:                             printf("+++System : Not enough memory\n");
 4463:                         }
 4464: 
 4465:                         return(EXIT_FAILURE);
 4466:                     }
 4467: 
 4468:                     sprintf((*s_etat_processus).nom_fichier_historique, "%s/%s",
 4469:                             home, ds_fichier_historique);
 4470: 
 4471:                     using_history();
 4472: 
 4473:                     // Pour pouvoir utiliser le keymap avant le premier
 4474:                     // appel à readline().
 4475:                     rl_initialize();
 4476: 
 4477:                     erreur_historique = read_history(
 4478:                             (*s_etat_processus).nom_fichier_historique);
 4479: 
 4480:                     gsl_set_error_handler(&traitement_exceptions_gsl);
 4481: 
 4482:                     if (drapeau_encart == 'Y')
 4483:                     {
 4484:                         (*s_etat_processus).erreur_systeme = d_es;
 4485:                         encart(s_etat_processus,
 4486:                                 (unsigned long) (5 * 1000000));
 4487: 
 4488:                         if ((*s_etat_processus).erreur_systeme != d_es)
 4489:                         {
 4490:                             if ((message = messages(s_etat_processus))
 4491:                                     == NULL)
 4492:                             {
 4493: #                               ifndef SEMAPHORES_NOMMES
 4494:                                     sem_post(&((*s_etat_processus)
 4495:                                             .semaphore_fork));
 4496:                                     sem_post(&semaphore_gestionnaires_signaux);
 4497:                                     sem_destroy(
 4498:                                             &semaphore_gestionnaires_signaux);
 4499:                                     sem_destroy(&((*s_etat_processus)
 4500:                                             .semaphore_fork));
 4501: #                               else
 4502:                                     sem_post((*s_etat_processus)
 4503:                                             .semaphore_fork);
 4504:                                     sem_post(semaphore_gestionnaires_signaux);
 4505:                                     sem_destroy2(
 4506:                                             semaphore_gestionnaires_signaux,
 4507:                                             getpid(), SEM_SIGNAUX);
 4508:                                     sem_destroy3((*s_etat_processus)
 4509:                                             .semphore_fork,
 4510:                                             getpid(), pthread_self(), SEM_FORK);
 4511: #                               endif
 4512: 
 4513:                                 liberation_contexte_cas(s_etat_processus);
 4514:                                 liberation_queue_signaux(s_etat_processus);
 4515: 
 4516: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4517:                                     stackoverflow_deinstall_handler();
 4518: #                               endif
 4519: 
 4520: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4521:                                     if (debug == d_faux)
 4522:                                     {
 4523:                                         sigsegv_deinstall_handler();
 4524:                                     }
 4525: #                               endif
 4526: 
 4527:                                 erreur = d_es_allocation_memoire;
 4528: 
 4529:                                 if ((*s_etat_processus).langue == 'F')
 4530:                                 {
 4531:                                     printf("+++Système : Mémoire "
 4532:                                             "insuffisante\n");
 4533:                                 }
 4534:                                 else
 4535:                                 {
 4536:                                     printf("+++System : Not enough "
 4537:                                             "memory\n");
 4538:                                 }
 4539: 
 4540:                                 return(EXIT_FAILURE);
 4541:                             }
 4542: 
 4543:                             printf("%s [%d]\n", message, (int) getpid());
 4544:                             free(message);
 4545: 
 4546:                             return(EXIT_FAILURE);
 4547:                         }
 4548:                     }
 4549: 
 4550:                     fflush(stdout);
 4551: 
 4552:                     if (arguments != NULL)
 4553:                     {
 4554:                         tampon = (*s_etat_processus).definitions_chainees;
 4555:                         (*s_etat_processus).definitions_chainees =
 4556:                                 arguments;
 4557: 
 4558:                         if (analyse_syntaxique(s_etat_processus) ==
 4559:                                 d_erreur)
 4560:                         {
 4561:                             if ((*s_etat_processus).erreur_systeme != d_es)
 4562:                             {
 4563: #                               ifndef SEMAPHORES_NOMMES
 4564:                                     sem_post(&((*s_etat_processus)
 4565:                                             .semaphore_fork));
 4566:                                     sem_post(&semaphore_gestionnaires_signaux);
 4567:                                     sem_destroy(
 4568:                                             &semaphore_gestionnaires_signaux);
 4569:                                     sem_destroy(&((*s_etat_processus)
 4570:                                             .semaphore_fork));
 4571: #                               else
 4572:                                     sem_post((*s_etat_processus)
 4573:                                             .semaphore_fork);
 4574:                                     sem_post(semaphore_gestionnaires_signaux);
 4575:                                     sem_destroy2(
 4576:                                             semaphore_gestionnaires_signaux,
 4577:                                             getpid(), SEM_SIGNAUX);
 4578:                                     sem_destroy3((*s_etat_processus)
 4579:                                             .semphore_fork,
 4580:                                             getpid(), pthread_self(), SEM_FORK);
 4581: #                               endif
 4582: 
 4583:                                 liberation_contexte_cas(s_etat_processus);
 4584:                                 liberation_queue_signaux(s_etat_processus);
 4585: 
 4586: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4587:                                     stackoverflow_deinstall_handler();
 4588: #                               endif
 4589: 
 4590: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4591:                                     if (debug == d_faux)
 4592:                                     {
 4593:                                         sigsegv_deinstall_handler();
 4594:                                     }
 4595: #                               endif
 4596: 
 4597:                                 erreur = d_es_allocation_memoire;
 4598: 
 4599:                                 if ((*s_etat_processus).langue == 'F')
 4600:                                 {
 4601:                                     printf("+++Système : Mémoire "
 4602:                                             "insuffisante\n");
 4603:                                 }
 4604:                                 else
 4605:                                 {
 4606:                                     printf("+++System : Not enough "
 4607:                                             "memory\n");
 4608:                                 }
 4609: 
 4610:                                 return(EXIT_FAILURE);
 4611:                             }
 4612:                             else
 4613:                             {
 4614: #                               ifndef SEMAPHORES_NOMMES
 4615:                                     sem_post(&((*s_etat_processus)
 4616:                                             .semaphore_fork));
 4617:                                     sem_post(&semaphore_gestionnaires_signaux);
 4618:                                     sem_destroy(
 4619:                                             &semaphore_gestionnaires_signaux);
 4620:                                     sem_destroy(&((*s_etat_processus)
 4621:                                             .semaphore_fork));
 4622: #                               else
 4623:                                     sem_post((*s_etat_processus)
 4624:                                             .semaphore_fork);
 4625:                                     sem_post(semaphore_gestionnaires_signaux);
 4626:                                     sem_destroy2(
 4627:                                             semaphore_gestionnaires_signaux,
 4628:                                             getpid(), SEM_SIGNAUX);
 4629:                                     sem_destroy3((*s_etat_processus)
 4630:                                             .semphore_fork,
 4631:                                             getpid(), pthread_self(), SEM_FORK);
 4632: #                               endif
 4633: 
 4634:                                 liberation_contexte_cas(s_etat_processus);
 4635:                                 liberation_queue_signaux(s_etat_processus);
 4636: 
 4637: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4638:                                     stackoverflow_deinstall_handler();
 4639: #                               endif
 4640: 
 4641: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4642:                                     if (debug == d_faux)
 4643:                                     {
 4644:                                         sigsegv_deinstall_handler();
 4645:                                     }
 4646: #                               endif
 4647: 
 4648:                                 if ((*s_etat_processus).langue == 'F')
 4649:                                 {
 4650:                                     printf("+++Erreur : Erreur de "
 4651:                                             "syntaxe\n");
 4652:                                 }
 4653:                                 else
 4654:                                 {
 4655:                                     printf("+++Error : Syntax error\n");
 4656:                                 }
 4657: 
 4658:                                 return(EXIT_FAILURE);
 4659:                             }
 4660:                         }
 4661: 
 4662:                         (*s_etat_processus).instruction_courante
 4663:                                 = arguments;
 4664:                         (*s_etat_processus).definitions_chainees = tampon;
 4665:                         (*s_etat_processus).position_courante = 0;
 4666: 
 4667:                         recherche_type(s_etat_processus);
 4668: 
 4669:                         if ((*s_etat_processus).erreur_systeme != d_es)
 4670:                         {
 4671: #                           ifndef SEMAPHORES_NOMMES
 4672:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4673:                                 sem_post(&semaphore_gestionnaires_signaux);
 4674:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4675:                                 sem_destroy(&((*s_etat_processus)
 4676:                                         .semaphore_fork));
 4677: #                           else
 4678:                                 sem_post((*s_etat_processus).semaphore_fork);
 4679:                                 sem_post(semaphore_gestionnaires_signaux);
 4680:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4681:                                         getpid(), SEM_SIGNAUX);
 4682:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4683:                                         getpid(), pthread_self(), SEM_FORK);
 4684: #                           endif
 4685: 
 4686:                             liberation_contexte_cas(s_etat_processus);
 4687:                             liberation_queue_signaux(s_etat_processus);
 4688: 
 4689: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4690:                                 stackoverflow_deinstall_handler();
 4691: #                           endif
 4692: 
 4693: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4694:                                 if (debug == d_faux)
 4695:                                 {
 4696:                                     sigsegv_deinstall_handler();
 4697:                                 }
 4698: #                           endif
 4699: 
 4700:                             if ((message = messages(s_etat_processus))
 4701:                                     == NULL)
 4702:                             {
 4703:                                 erreur = d_es_allocation_memoire;
 4704: 
 4705:                                 if ((*s_etat_processus).langue == 'F')
 4706:                                 {
 4707:                                     printf("+++Système : Mémoire "
 4708:                                             "insuffisante\n");
 4709:                                 }
 4710:                                 else
 4711:                                 {
 4712:                                     printf("+++System : Not enough "
 4713:                                             "memory\n");
 4714:                                 }
 4715: 
 4716:                                 return(EXIT_FAILURE);
 4717:                             }
 4718: 
 4719:                             printf("%s [%d]\n", message, (int) getpid());
 4720:                             free(message);
 4721: 
 4722:                             return(EXIT_FAILURE);
 4723:                         }
 4724: 
 4725:                         if ((*s_etat_processus).erreur_execution != d_ex)
 4726:                         {
 4727:                             if ((message = messages(s_etat_processus))
 4728:                                     == NULL)
 4729:                             {
 4730: #                               ifndef SEMAPHORES_NOMMES
 4731:                                     sem_post(&((*s_etat_processus)
 4732:                                             .semaphore_fork));
 4733:                                     sem_post(&semaphore_gestionnaires_signaux);
 4734:                                     sem_destroy(
 4735:                                             &semaphore_gestionnaires_signaux);
 4736:                                     sem_destroy(&((*s_etat_processus)
 4737:                                             .semaphore_fork));
 4738: #                               else
 4739:                                     sem_post((*s_etat_processus)
 4740:                                             .semaphore_fork);
 4741:                                     sem_post(semaphore_gestionnaires_signaux);
 4742:                                     sem_destroy2(
 4743:                                             semaphore_gestionnaires_signaux,
 4744:                                             getpid(), SEM_SIGNAUX);
 4745:                                     sem_destroy3((*s_etat_processus)
 4746:                                             .semphore_fork,
 4747:                                             getpid(), pthread_self(), SEM_FORK);
 4748: #                               endif
 4749: 
 4750:                                 liberation_contexte_cas(s_etat_processus);
 4751:                                 liberation_queue_signaux(s_etat_processus);
 4752: 
 4753: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4754:                                     stackoverflow_deinstall_handler();
 4755: #                               endif
 4756: 
 4757: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4758:                                     if (debug == d_faux)
 4759:                                     {
 4760:                                         sigsegv_deinstall_handler();
 4761:                                     }
 4762: #                               endif
 4763: 
 4764:                                 erreur = d_es_allocation_memoire;
 4765: 
 4766:                                 if ((*s_etat_processus).langue == 'F')
 4767:                                 {
 4768:                                     printf("+++Erreur : Mémoire "
 4769:                                             "insuffisante\n");
 4770:                                 }
 4771:                                 else
 4772:                                 {
 4773:                                     printf("+++Error : Not enough "
 4774:                                             "memory\n");
 4775:                                 }
 4776: 
 4777:                                 return(EXIT_FAILURE);
 4778:                             }
 4779: 
 4780:                             printf("%s [%d]\n", message, (int) getpid());
 4781:                             free(message);
 4782: 
 4783: #                           ifndef SEMAPHORES_NOMMES
 4784:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4785:                                 sem_post(&semaphore_gestionnaires_signaux);
 4786:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4787:                                 sem_destroy(&((*s_etat_processus)
 4788:                                         .semaphore_fork));
 4789: #                           else
 4790:                                 sem_post((*s_etat_processus).semaphore_fork);
 4791:                                 sem_post(semaphore_gestionnaires_signaux);
 4792:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4793:                                         getpid(), SEM_SIGNAUX);
 4794:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4795:                                         getpid(), pthread_self(), SEM_FORK);
 4796: #                           endif
 4797: 
 4798:                             liberation_contexte_cas(s_etat_processus);
 4799:                             liberation_queue_signaux(s_etat_processus);
 4800: 
 4801: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4802:                                 stackoverflow_deinstall_handler();
 4803: #                           endif
 4804: 
 4805: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4806:                                 if (debug == d_faux)
 4807:                                 {
 4808:                                     sigsegv_deinstall_handler();
 4809:                                 }
 4810: #                           endif
 4811: 
 4812:                             return(EXIT_FAILURE);
 4813:                         }
 4814: 
 4815:                         if (depilement(s_etat_processus,
 4816:                                 &((*s_etat_processus).l_base_pile),
 4817:                                 &s_objet) == d_erreur)
 4818:                         {
 4819:                             if ((message = messages(s_etat_processus))
 4820:                                     == NULL)
 4821:                             {
 4822: #                               ifndef SEMAPHORES_NOMMES
 4823:                                     sem_post(&((*s_etat_processus)
 4824:                                             .semaphore_fork));
 4825:                                     sem_post(&semaphore_gestionnaires_signaux);
 4826:                                     sem_destroy(
 4827:                                             &semaphore_gestionnaires_signaux);
 4828:                                     sem_destroy(&((*s_etat_processus)
 4829:                                             .semaphore_fork));
 4830: #                               else
 4831:                                     sem_post((*s_etat_processus)
 4832:                                             .semaphore_fork);
 4833:                                     sem_post(semaphore_gestionnaires_signaux);
 4834:                                     sem_destroy2(
 4835:                                             semaphore_gestionnaires_signaux,
 4836:                                             getpid(), SEM_SIGNAUX);
 4837:                                     sem_destroy3((*s_etat_processus)
 4838:                                             .semphore_fork,
 4839:                                             getpid(), pthread_self(), SEM_FORK);
 4840: #                               endif
 4841: 
 4842:                                 liberation_contexte_cas(s_etat_processus);
 4843:                                 liberation_queue_signaux(s_etat_processus);
 4844: 
 4845: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4846:                                     stackoverflow_deinstall_handler();
 4847: #                               endif
 4848: 
 4849: #                               ifdef HAVE_SIGSEGV_RECOVERY
 4850:                                     if (debug == d_faux)
 4851:                                     {
 4852:                                         sigsegv_deinstall_handler();
 4853:                                     }
 4854: #                               endif
 4855: 
 4856:                                 erreur = d_es_allocation_memoire;
 4857:                                 erreur = d_es_allocation_memoire;
 4858: 
 4859:                                 if ((*s_etat_processus).langue == 'F')
 4860:                                 {
 4861:                                     printf("+++Erreur : Mémoire "
 4862:                                             "insuffisante\n");
 4863:                                 }
 4864:                                 else
 4865:                                 {
 4866:                                     printf("+++Error : Not enough "
 4867:                                             "memory\n");
 4868:                                 }
 4869: 
 4870:                                 return(EXIT_FAILURE);
 4871:                             }
 4872: 
 4873:                             printf("%s [%d]\n", message, (int) getpid());
 4874:                             free(message);
 4875: 
 4876: #                           ifndef SEMAPHORES_NOMMES
 4877:                                 sem_post(&((*s_etat_processus).semaphore_fork));
 4878:                                 sem_post(&semaphore_gestionnaires_signaux);
 4879:                                 sem_destroy(&semaphore_gestionnaires_signaux);
 4880:                                 sem_destroy(&((*s_etat_processus)
 4881:                                         .semaphore_fork));
 4882: #                           else
 4883:                                 sem_post((*s_etat_processus).semaphore_fork);
 4884:                                 sem_post(semaphore_gestionnaires_signaux);
 4885:                                 sem_destroy2(semaphore_gestionnaires_signaux,
 4886:                                         getpid(), SEM_SIGNAUX);
 4887:                                 sem_destroy3((*s_etat_processus).semphore_fork,
 4888:                                         getpid(), pthread_self(), SEM_FORK);
 4889: #                           endif
 4890: 
 4891:                             liberation_contexte_cas(s_etat_processus);
 4892:                             liberation_queue_signaux(s_etat_processus);
 4893: 
 4894: #                           ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4895:                                 stackoverflow_deinstall_handler();
 4896: #                           endif
 4897: 
 4898: #                           ifdef HAVE_SIGSEGV_RECOVERY
 4899:                                 if (debug == d_faux)
 4900:                                 {
 4901:                                     sigsegv_deinstall_handler();
 4902:                                 }
 4903: #                           endif
 4904: 
 4905:                             return(EXIT_FAILURE);
 4906:                         }
 4907: 
 4908:                         if (evaluation(s_etat_processus, s_objet, 'E')
 4909:                                 == d_erreur)
 4910:                         {
 4911:                             if ((*s_etat_processus).erreur_systeme != d_es)
 4912:                             {
 4913:                                 if ((message = messages(s_etat_processus))
 4914:                                         == NULL)
 4915:                                 {
 4916: #                                   ifndef SEMAPHORES_NOMMES
 4917:                                         sem_post(&((*s_etat_processus)
 4918:                                                 .semaphore_fork));
 4919:                                         sem_post(
 4920:                                                 &semaphore_gestionnaires_signaux
 4921:                                                 );
 4922:                                         sem_destroy(
 4923:                                                 &semaphore_gestionnaires_signaux
 4924:                                                 );
 4925:                                         sem_destroy(&((*s_etat_processus)
 4926:                                                 .semaphore_fork));
 4927: #                                   else
 4928:                                         sem_post((*s_etat_processus)
 4929:                                                 .semaphore_fork);
 4930:                                         sem_post(
 4931:                                                 semaphore_gestionnaires_signaux
 4932:                                                 );
 4933:                                         sem_destroy2(
 4934:                                                 semaphore_gestionnaires_signaux,
 4935:                                                 getpid(), SEM_SIGNAUX);
 4936:                                         sem_destroy3((*s_etat_processus)
 4937:                                                 .semphore_fork, getpid(),
 4938:                                                 pthread_self(), SEM_FORK);
 4939: #                                   endif
 4940: 
 4941:                                     liberation_contexte_cas(s_etat_processus);
 4942:                                     liberation_queue_signaux(s_etat_processus);
 4943: 
 4944: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4945:                                         stackoverflow_deinstall_handler();
 4946: #                                   endif
 4947: 
 4948: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 4949:                                         if (debug == d_faux)
 4950:                                         {
 4951:                                             sigsegv_deinstall_handler();
 4952:                                         }
 4953: #                                   endif
 4954: 
 4955:                                     erreur = d_es_allocation_memoire;
 4956: 
 4957:                                     if ((*s_etat_processus).langue == 'F')
 4958:                                     {
 4959:                                         printf("+++Système : Mémoire "
 4960:                                                 "insuffisante\n");
 4961:                                     }
 4962:                                     else
 4963:                                     {
 4964:                                         printf("+++System : Not enough "
 4965:                                                 "memory\n");
 4966:                                     }
 4967: 
 4968:                                     return(EXIT_FAILURE);
 4969:                                 }
 4970: 
 4971:                                 printf("%s [%d]\n", message,
 4972:                                         (int) getpid());
 4973:                                 free(message);
 4974: 
 4975: #                               ifndef SEMAPHORES_NOMMES
 4976:                                     sem_post(&((*s_etat_processus)
 4977:                                             .semaphore_fork));
 4978:                                     sem_post(&semaphore_gestionnaires_signaux);
 4979:                                     sem_destroy(
 4980:                                             &semaphore_gestionnaires_signaux);
 4981:                                     sem_destroy(&((*s_etat_processus)
 4982:                                             .semaphore_fork));
 4983: #                               else
 4984:                                     sem_post((*s_etat_processus)
 4985:                                             .semaphore_fork);
 4986:                                     sem_post(semaphore_gestionnaires_signaux);
 4987:                                     sem_destroy2(
 4988:                                             semaphore_gestionnaires_signaux,
 4989:                                             getpid(), SEM_SIGNAUX);
 4990:                                     sem_destroy3((*s_etat_processus)
 4991:                                             .semphore_fork,
 4992:                                             getpid(), pthread_self(), SEM_FORK);
 4993: #                               endif
 4994: 
 4995:                                 liberation_contexte_cas(s_etat_processus);
 4996:                                 liberation_queue_signaux(s_etat_processus);
 4997: 
 4998: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 4999:                                     stackoverflow_deinstall_handler();
 5000: #                               endif
 5001: 
 5002: #                               ifdef HAVE_SIGSEGV_RECOVERY
 5003:                                     if (debug == d_faux)
 5004:                                     {
 5005:                                         sigsegv_deinstall_handler();
 5006:                                     }
 5007: #                               endif
 5008: 
 5009:                                 erreur = d_es_allocation_memoire;
 5010:                                 return(EXIT_FAILURE);
 5011:                             }
 5012: 
 5013:                             if ((*s_etat_processus).erreur_execution
 5014:                                     != d_ex)
 5015:                             {
 5016:                                 if ((message = messages(s_etat_processus))
 5017:                                         == NULL)
 5018:                                 {
 5019: #                                   ifndef SEMAPHORES_NOMMES
 5020:                                         sem_post(&((*s_etat_processus)
 5021:                                                 .semaphore_fork));
 5022:                                         sem_post(
 5023:                                                 &semaphore_gestionnaires_signaux
 5024:                                                 );
 5025:                                         sem_destroy(
 5026:                                                 &semaphore_gestionnaires_signaux
 5027:                                                 );
 5028:                                         sem_destroy(&((*s_etat_processus)
 5029:                                                 .semaphore_fork));
 5030: #                                   else
 5031:                                         sem_post((*s_etat_processus)
 5032:                                                 .semaphore_fork);
 5033:                                         sem_post(
 5034:                                                 semaphore_gestionnaires_signaux
 5035:                                                 );
 5036:                                         sem_destroy2(
 5037:                                                 semaphore_gestionnaires_signaux,
 5038:                                                 getpid(), SEM_SIGNAUX);
 5039:                                         sem_destroy3((*s_etat_processus)
 5040:                                                 .semphore_fork, getpid(),
 5041:                                                 pthread_self(), SEM_FORK);
 5042: #                                   endif
 5043: 
 5044:                                     liberation_contexte_cas(s_etat_processus);
 5045:                                     liberation_queue_signaux(s_etat_processus);
 5046: 
 5047: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5048:                                         stackoverflow_deinstall_handler();
 5049: #                                   endif
 5050: 
 5051: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 5052:                                         if (debug == d_faux)
 5053:                                         {
 5054:                                             sigsegv_deinstall_handler();
 5055:                                         }
 5056: #                                   endif
 5057: 
 5058:                                     erreur = d_es_allocation_memoire;
 5059: 
 5060:                                     if ((*s_etat_processus).langue == 'F')
 5061:                                     {
 5062:                                         printf("+++Erreur : Mémoire "
 5063:                                                 "insuffisante\n");
 5064:                                     }
 5065:                                     else
 5066:                                     {
 5067:                                         printf("+++Error : Not enough "
 5068:                                                 "memory\n");
 5069:                                     }
 5070: 
 5071:                                     return(EXIT_FAILURE);
 5072:                                 }
 5073: 
 5074:                                 printf("%s [%d]\n", message,
 5075:                                         (int) getpid());
 5076:                                 free(message);
 5077: 
 5078: #                               ifndef SEMAPHORES_NOMMES
 5079:                                     sem_post(&((*s_etat_processus)
 5080:                                             .semaphore_fork));
 5081:                                     sem_post(&semaphore_gestionnaires_signaux);
 5082:                                     sem_destroy(
 5083:                                             &semaphore_gestionnaires_signaux);
 5084:                                     sem_destroy(&((*s_etat_processus)
 5085:                                             .semaphore_fork));
 5086: #                               else
 5087:                                     sem_post((*s_etat_processus)
 5088:                                             .semaphore_fork);
 5089:                                     sem_post(semaphore_gestionnaires_signaux);
 5090:                                     sem_destroy2(
 5091:                                             semaphore_gestionnaires_signaux,
 5092:                                             getpid(), SEM_SIGNAUX);
 5093:                                     sem_destroy3((*s_etat_processus)
 5094:                                             .semphore_fork,
 5095:                                             getpid(), pthread_self(), SEM_FORK);
 5096: #                               endif
 5097: 
 5098:                                 liberation_contexte_cas(s_etat_processus);
 5099:                                 liberation_queue_signaux(s_etat_processus);
 5100: 
 5101: #                               ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5102:                                     stackoverflow_deinstall_handler();
 5103: #                               endif
 5104: 
 5105: #                               ifdef HAVE_SIGSEGV_RECOVERY
 5106:                                     if (debug == d_faux)
 5107:                                     {
 5108:                                         sigsegv_deinstall_handler();
 5109:                                     }
 5110: #                               endif
 5111: 
 5112:                                 return(EXIT_FAILURE);
 5113:                             }
 5114:                         }
 5115: 
 5116:                         (*s_etat_processus).instruction_courante = NULL;
 5117:                         liberation(s_etat_processus, s_objet);
 5118: 
 5119:                         free(arguments);
 5120:                     }
 5121: 
 5122:                     if (option_a == d_vrai)
 5123:                     {
 5124:                         fprintf(stdout, "%s\n", (*s_etat_processus)
 5125:                                 .definitions_chainees);
 5126:                     }
 5127:                     else
 5128:                     {
 5129:                         if (option_D == d_vrai)
 5130:                         {
 5131:                             lancement_daemon(s_etat_processus);
 5132:                         }
 5133: 
 5134:                         if (option_p == d_faux)
 5135:                         {
 5136:                             if (setjmp(contexte_initial) == 0)
 5137:                             {
 5138:                                 erreur = sequenceur(s_etat_processus);
 5139: 
 5140:                                 if (erreur == d_absence_erreur)
 5141:                                 {
 5142:                                     if (((*s_etat_processus).var_volatile_alarme
 5143:                                             == 0) && ((*s_etat_processus)
 5144:                                             .arret_depuis_abort == 0) &&
 5145:                                             ((*s_etat_processus).at_exit
 5146:                                             != NULL))
 5147:                                     {
 5148:                                         erreur = evaluation(s_etat_processus,
 5149:                                                 (*s_etat_processus).at_exit,
 5150:                                                 'E');
 5151:                                     }
 5152:                                 }
 5153:                             }
 5154:                         }
 5155:                         else
 5156:                         {
 5157:                             if (setjmp(contexte_initial) == 0)
 5158:                             {
 5159:                                 erreur = sequenceur_optimise(s_etat_processus);
 5160: 
 5161:                                 if (erreur == d_absence_erreur)
 5162:                                 {
 5163:                                     if (((*s_etat_processus).var_volatile_alarme
 5164:                                             == 0) && ((*s_etat_processus)
 5165:                                             .arret_depuis_abort == 0) &&
 5166:                                             ((*s_etat_processus).at_exit
 5167:                                             != NULL))
 5168:                                     {
 5169:                                         erreur = evaluation(s_etat_processus,
 5170:                                                 (*s_etat_processus).at_exit,
 5171:                                                 'E');
 5172:                                     }
 5173:                                 }
 5174:                             }
 5175:                         }
 5176:                     }
 5177: 
 5178:                     for(i = 0; i < (*s_etat_processus).sections_critiques; i++)
 5179:                     {
 5180:                         pthread_mutex_unlock(&mutex_sections_critiques);
 5181:                     }
 5182: 
 5183:                     liberation(s_etat_processus, (*s_etat_processus).at_exit);
 5184:                     liberation(s_etat_processus, (*s_etat_processus).at_poke);
 5185: 
 5186:                     if ((*s_etat_processus).generateur_aleatoire != NULL)
 5187:                     {
 5188:                         liberation_generateur_aleatoire(s_etat_processus);
 5189:                     }
 5190: 
 5191:                     l_element_courant = (*s_etat_processus).liste_mutexes;
 5192:                     while(l_element_courant != NULL)
 5193:                     {
 5194:                         liberation(s_etat_processus,
 5195:                                 (*((struct_liste_chainee *)
 5196:                                 l_element_courant)).donnee);
 5197:                         l_element_suivant = (*((struct_liste_chainee *)
 5198:                                 l_element_courant)).suivant;
 5199:                         free((struct_liste_chainee *) l_element_courant);
 5200:                         l_element_courant = l_element_suivant;
 5201:                     }
 5202: 
 5203:                     /*
 5204:                      * Arrêt des processus fils
 5205:                      */
 5206: 
 5207:                     if ((*s_etat_processus).presence_fusible == d_vrai)
 5208:                     {
 5209:                         pthread_cancel((*s_etat_processus).thread_fusible);
 5210:                     }
 5211: 
 5212:                     pthread_mutex_lock(&((*s_etat_processus).mutex));
 5213: 
 5214:                     l_element_courant = (void *) (*s_etat_processus)
 5215:                             .l_base_pile_processus;
 5216: 
 5217:                     while(l_element_courant != NULL)
 5218:                     {
 5219:                         if ((*s_etat_processus).debug == d_vrai)
 5220:                         {
 5221:                             if (((*s_etat_processus).type_debug &
 5222:                                     d_debug_processus) != 0)
 5223:                             {
 5224:                                 if ((*(*((struct_processus_fils *)
 5225:                                         (*(*((struct_liste_chainee *)
 5226:                                         l_element_courant)).donnee)
 5227:                                         .objet)).thread)
 5228:                                         .processus_detache == d_vrai)
 5229:                                 {
 5230:                                     if ((*s_etat_processus).langue == 'F')
 5231:                                     {
 5232:                                         printf("[%d] Signalement pour arrêt du "
 5233:                                                 "processus %d\n",
 5234:                                                 (int) getpid(), (int)
 5235:                                                 (*(*((struct_processus_fils *)
 5236:                                                 (*(*((struct_liste_chainee *)
 5237:                                                 l_element_courant)).donnee)
 5238:                                                 .objet)).thread).pid);
 5239:                                     }
 5240:                                     else
 5241:                                     {
 5242:                                         printf("[%d] Send stop signal to "
 5243:                                                 "process %d\n",
 5244:                                                 (int) getpid(), (int)
 5245:                                                 (*(*((struct_processus_fils *)
 5246:                                                 (*(*((struct_liste_chainee *)
 5247:                                                 l_element_courant)).donnee)
 5248:                                                 .objet)).thread).pid);
 5249:                                     }
 5250:                                 }
 5251:                                 else
 5252:                                 {
 5253:                                     if ((*s_etat_processus).langue == 'F')
 5254:                                     {
 5255:                                         printf("[%d] Signalement pour arrêt du "
 5256:                                                 "thread %llu\n", (int) getpid(),
 5257:                                                 (unsigned long long)
 5258:                                                 (*(*((struct_processus_fils *)
 5259:                                                 (*(*((struct_liste_chainee *)
 5260:                                                 l_element_courant)).donnee)
 5261:                                                 .objet)).thread).tid);
 5262:                                     }
 5263:                                     else
 5264:                                     {
 5265:                                         printf("[%d] Send stop signal to "
 5266:                                                 "thread %llu\n",
 5267:                                                 (int) getpid(),
 5268:                                                 (unsigned long long)
 5269:                                                 (*(*((struct_processus_fils *)
 5270:                                                 (*(*((struct_liste_chainee *)
 5271:                                                 l_element_courant)).donnee)
 5272:                                                 .objet)).thread).tid);
 5273:                                     }
 5274:                                 }
 5275:                             }
 5276:                         }
 5277: 
 5278:                         if ((*(*((struct_processus_fils *)
 5279:                                 (*(*((struct_liste_chainee *)
 5280:                                 l_element_courant)).donnee).objet))
 5281:                                 .thread).processus_detache == d_vrai)
 5282:                         {
 5283:                             if ((*s_etat_processus).var_volatile_alarme != 0)
 5284:                             {
 5285:                                 envoi_signal_processus(
 5286:                                         (*(*((struct_processus_fils *)
 5287:                                         (*(*((struct_liste_chainee *)
 5288:                                         l_element_courant)).donnee).objet))
 5289:                                         .thread).pid, rpl_sigurg);
 5290:                             }
 5291:                             else
 5292:                             {
 5293:                                 if ((*s_etat_processus).arret_depuis_abort
 5294:                                         == -1)
 5295:                                 {
 5296:                                     envoi_signal_processus(
 5297:                                             (*(*((struct_processus_fils *)
 5298:                                             (*(*((struct_liste_chainee *)
 5299:                                             l_element_courant)).donnee).objet))
 5300:                                             .thread).pid, rpl_sigabort);
 5301:                                 }
 5302:                                 else
 5303:                                 {
 5304:                                     envoi_signal_processus(
 5305:                                             (*(*((struct_processus_fils *)
 5306:                                             (*(*((struct_liste_chainee *)
 5307:                                             l_element_courant)).donnee).objet))
 5308:                                             .thread).pid, rpl_sigstop);
 5309:                                 }
 5310:                             }
 5311:                         }
 5312:                         else
 5313:                         {
 5314:                             pthread_mutex_lock(&((*(*((struct_processus_fils *)
 5315:                                     (*(*((struct_liste_chainee *)
 5316:                                     l_element_courant)).donnee).objet)).thread)
 5317:                                     .mutex));
 5318: 
 5319:                             if ((*(*((struct_processus_fils *)
 5320:                                     (*(*((struct_liste_chainee *)
 5321:                                     l_element_courant)).donnee).objet)).thread)
 5322:                                     .thread_actif == d_vrai)
 5323:                             {
 5324:                                 if ((*s_etat_processus).var_volatile_alarme
 5325:                                         != 0)
 5326:                                 {
 5327:                                     envoi_signal_thread(
 5328:                                             (*(*((struct_processus_fils *)
 5329:                                             (*(*((struct_liste_chainee *)
 5330:                                             l_element_courant)).donnee).objet))
 5331:                                             .thread).tid, rpl_sigurg);
 5332:                                 }
 5333:                                 else
 5334:                                 {
 5335:                                     if ((*s_etat_processus).arret_depuis_abort
 5336:                                             == -1)
 5337:                                     {
 5338:                                         envoi_signal_thread(
 5339:                                                 (*(*((struct_processus_fils *)
 5340:                                                 (*(*((struct_liste_chainee *)
 5341:                                                 l_element_courant)).donnee)
 5342:                                                 .objet)).thread).tid,
 5343:                                                 rpl_sigabort);
 5344:                                     }
 5345:                                     else
 5346:                                     {
 5347:                                         envoi_signal_thread(
 5348:                                                 (*(*((struct_processus_fils *)
 5349:                                                 (*(*((struct_liste_chainee *)
 5350:                                                 l_element_courant)).donnee)
 5351:                                                 .objet)).thread).tid,
 5352:                                                 rpl_sigstop);
 5353:                                     }
 5354:                                 }
 5355:                             }
 5356: 
 5357:                             pthread_mutex_unlock(
 5358:                                     &((*(*((struct_processus_fils *)
 5359:                                     (*(*((struct_liste_chainee *)
 5360:                                     l_element_courant)).donnee).objet)).thread)
 5361:                                     .mutex));
 5362:                         }
 5363: 
 5364:                         l_element_courant = (*((struct_liste_chainee *)
 5365:                                 l_element_courant)).suivant;
 5366:                     }
 5367: 
 5368:                     /*
 5369:                      * Attente de la fin de tous les processus fils
 5370:                      */
 5371: 
 5372:                     for(i = 0; i < d_NOMBRE_INTERRUPTIONS;
 5373:                             (*s_etat_processus).masque_interruptions[i++]
 5374:                             = 'I');
 5375: 
 5376:                     attente.tv_sec = 0;
 5377:                     attente.tv_nsec = GRANULARITE_us * 1000;
 5378: 
 5379:                     while((*s_etat_processus).l_base_pile_processus != NULL)
 5380:                     {
 5381:                         l_element_courant = (void *)
 5382:                                 (*s_etat_processus).l_base_pile_processus;
 5383: 
 5384:                         for(i = 0; i < (*(*((struct_processus_fils *)
 5385:                                 (*(*((struct_liste_chainee *)
 5386:                                 l_element_courant)).donnee).objet)).thread)
 5387:                                 .nombre_objets_dans_pipe; i++)
 5388:                         {
 5389:                             if ((s_objet = lecture_pipe(
 5390:                                     s_etat_processus,
 5391:                                     (*(*((struct_processus_fils *)
 5392:                                     (*(*((struct_liste_chainee *)
 5393:                                     l_element_courant)).donnee).objet)).thread)
 5394:                                     .pipe_objets[0])) != NULL)
 5395:                             {
 5396:                                 liberation(s_etat_processus, s_objet);
 5397: 
 5398:                                 (*(*((struct_processus_fils *)
 5399:                                         (*(*((struct_liste_chainee *)
 5400:                                         l_element_courant)).donnee).objet))
 5401:                                         .thread).nombre_objets_dans_pipe--;
 5402: 
 5403:                                 action.sa_handler = SIG_IGN;
 5404:                                 action.sa_flags = 0;
 5405: 
 5406:                                 if (sigaction(SIGPIPE, &action, &registre)
 5407:                                         != 0)
 5408:                                 {
 5409: #                                   ifndef SEMAPHORES_NOMMES
 5410:                                         sem_post(&((*s_etat_processus)
 5411:                                                 .semaphore_fork));
 5412:                                         sem_post(
 5413:                                                 &semaphore_gestionnaires_signaux
 5414:                                                 );
 5415:                                         sem_destroy(
 5416:                                                 &semaphore_gestionnaires_signaux
 5417:                                                 );
 5418:                                         sem_destroy(&((*s_etat_processus)
 5419:                                                 .semaphore_fork));
 5420: #                                   else
 5421:                                         sem_post((*s_etat_processus)
 5422:                                                 .semaphore_fork);
 5423:                                         sem_post(
 5424:                                                 semaphore_gestionnaires_signaux
 5425:                                                 );
 5426:                                         sem_destroy2(
 5427:                                                 semaphore_gestionnaires_signaux,
 5428:                                                 getpid(), SEM_SIGNAUX);
 5429:                                         sem_destroy3((*s_etat_processus)
 5430:                                                 .semphore_fork, getpid(),
 5431:                                                 pthread_self(), SEM_FORK);
 5432: #                                   endif
 5433: 
 5434:                                     liberation_contexte_cas(s_etat_processus);
 5435:                                     liberation_queue_signaux(s_etat_processus);
 5436: 
 5437: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5438:                                         stackoverflow_deinstall_handler();
 5439: #                                   endif
 5440: 
 5441: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 5442:                                         if (debug == d_faux)
 5443:                                         {
 5444:                                             sigsegv_deinstall_handler();
 5445:                                         }
 5446: #                                   endif
 5447: 
 5448:                                     pthread_mutex_unlock(
 5449:                                             &((*s_etat_processus).mutex));
 5450:                                     return(EXIT_FAILURE);
 5451:                                 }
 5452: 
 5453:                                 while((longueur_ecriture =
 5454:                                         write_atomic(s_etat_processus,
 5455:                                         (*(*((struct_processus_fils *)
 5456:                                         (*(*((struct_liste_chainee *)
 5457:                                         l_element_courant)).donnee).objet))
 5458:                                         .thread).pipe_nombre_injections[1], "+",
 5459:                                         sizeof(unsigned char))) !=
 5460:                                         sizeof(unsigned char))
 5461:                                 {
 5462:                                     if (longueur_ecriture == -1)
 5463:                                     {
 5464:                                         // Le processus n'existe plus.
 5465:                                         break;
 5466:                                     }
 5467:                                 }
 5468: 
 5469:                                 if (sigaction(SIGPIPE, &registre, NULL)
 5470:                                         != 0)
 5471:                                 {
 5472: #                                   ifndef SEMAPHORES_NOMMES
 5473:                                         sem_post(&((*s_etat_processus)
 5474:                                                 .semaphore_fork));
 5475:                                         sem_post(
 5476:                                                 &semaphore_gestionnaires_signaux
 5477:                                                 );
 5478:                                         sem_destroy(
 5479:                                                 &semaphore_gestionnaires_signaux
 5480:                                                 );
 5481:                                         sem_destroy(&((*s_etat_processus)
 5482:                                                 .semaphore_fork));
 5483: #                                   else
 5484:                                         sem_post((*s_etat_processus)
 5485:                                                 .semaphore_fork);
 5486:                                         sem_post(
 5487:                                                 semaphore_gestionnaires_signaux
 5488:                                                 );
 5489:                                         sem_destroy2(
 5490:                                                 semaphore_gestionnaires_signaux,
 5491:                                                 getpid(), SEM_SIGNAUX);
 5492:                                         sem_destroy3((*s_etat_processus)
 5493:                                                 .semphore_fork, getpid(),
 5494:                                                 pthread_self(), SEM_FORK);
 5495: #                                   endif
 5496: 
 5497:                                     liberation_contexte_cas(s_etat_processus);
 5498:                                     liberation_queue_signaux(s_etat_processus);
 5499: 
 5500: #                                   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 5501:                                         stackoverflow_deinstall_handler();
 5502: #                                   endif
 5503: 
 5504: #                                   ifdef HAVE_SIGSEGV_RECOVERY
 5505:                                         if (debug == d_faux)
 5506:                                         {
 5507:                                             sigsegv_deinstall_handler();
 5508:                                         }
 5509: #                                   endif
 5510: 
 5511:                                     pthread_mutex_unlock(
 5512:                                             &((*s_etat_processus).mutex));
 5513:                                     return(EXIT_FAILURE);
 5514:                                 }
 5515:                             }
 5516:                         }
 5517: 
 5518:                         pthread_mutex_unlock(&((*s_etat_processus).mutex));
 5519: 
 5520:                         if ((*s_etat_processus)
 5521:                                 .nombre_interruptions_non_affectees != 0)
 5522:                         {
 5523:                             affectation_interruptions_logicielles(
 5524:                                     s_etat_processus);
 5525:                         }
 5526: 
 5527:                         nanosleep(&attente, NULL);
 5528:                         scrutation_interruptions(s_etat_processus);
 5529:                         pthread_mutex_lock(&((*s_etat_processus).mutex));
 5530:                     }
 5531: 
 5532:                     pthread_mutex_unlock(&((*s_etat_processus).mutex));
 5533: 
 5534:                     erreur_historique = write_history(
 5535:                             (*s_etat_processus).nom_fichier_historique);
 5536:                     clear_history();
 5537: 
 5538:                     if (erreur_historique != 0)
 5539:                     {
 5540:                         if ((*s_etat_processus).langue == 'F')
 5541:                         {
 5542:                             printf("+++Erreur : L'historique ne peut être "
 5543:                                     "écrit\n");
 5544:                         }
 5545:                         else
 5546:                         {
 5547:                             printf("+++Error : History cannot be "
 5548:                                     "written\n");
 5549:                         }
 5550: 
 5551:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 5552:                         {
 5553:                             printf("%s", ds_beep);
 5554:                         }
 5555:                     }
 5556: 
 5557:                     free((*s_etat_processus).nom_fichier_historique);
 5558: 
 5559:                     if (((*s_etat_processus).core == d_vrai) &&
 5560:                             (erreur == d_erreur) &&
 5561:                             ((*s_etat_processus).var_volatile_traitement_sigint
 5562:                             == 0))
 5563:                     {
 5564:                         printf("\n");
 5565:                         
 5566:                         if ((*s_etat_processus).langue == 'F')
 5567:                         {
 5568:                             printf("+++Information : Génération du fichier "
 5569:                                     "rpl-core [%d]\n", (int) getpid());
 5570:                         }
 5571:                         else
 5572:                         {
 5573:                             printf("+++Information : Writing rpl-core "
 5574:                                     "file [%d]\n", (int) getpid());
 5575:                         }
 5576: 
 5577:                         rplcore(s_etat_processus);
 5578: 
 5579:                         if ((*s_etat_processus).langue == 'F')
 5580:                         {
 5581:                             printf("+++Information : Processus tracé [%d]\n",
 5582:                                     (int) getpid());
 5583:                         }
 5584:                         else
 5585:                         {
 5586:                             printf("+++Information : Done [%d]\n",
 5587:                                     (int) getpid());
 5588:                         }
 5589: 
 5590:                         printf("\n");
 5591:                     }
 5592: 
 5593:                     free((*s_etat_processus).definitions_chainees);
 5594: 
 5595:                     /*
 5596:                      * Libération de l'arbre des instructions
 5597:                      */
 5598: 
 5599:                     liberation_arbre_instructions(s_etat_processus,
 5600:                             (*s_etat_processus).arbre_instructions);
 5601:                     free((*s_etat_processus).pointeurs_caracteres);
 5602: 
 5603:                     if ((*s_etat_processus).entree_standard != NULL)
 5604:                     {
 5605:                         pclose((*s_etat_processus).entree_standard);
 5606:                         (*s_etat_processus).entree_standard = NULL;
 5607:                     }
 5608: 
 5609:                     if ((*s_etat_processus).nom_fichier_impression != NULL)
 5610:                     {
 5611:                         if (test_cfsf(s_etat_processus, 51) == d_faux)
 5612:                         {
 5613:                             printf("%s", ds_beep);
 5614:                         }
 5615: 
 5616:                         if ((*s_etat_processus).langue == 'F')
 5617:                         {
 5618:                             printf("+++Attention : Queue d'impression "
 5619:                                     "non vide !\n");
 5620:                         }
 5621:                         else
 5622:                         {
 5623:                             printf("+++Warning : Non empty printing "
 5624:                                     "spool queue !\n");
 5625:                         }
 5626: 
 5627:                         instruction_erase(s_etat_processus);
 5628:                     }
 5629: 
 5630:                     if ((*s_etat_processus).fichiers_graphiques != NULL)
 5631:                     {
 5632:                         instruction_cllcd(s_etat_processus);
 5633:                     }
 5634: 
 5635:                     liberation(s_etat_processus, (*s_etat_processus).indep);
 5636:                     liberation(s_etat_processus, (*s_etat_processus).depend);
 5637: 
 5638:                     free((*s_etat_processus).label_x);
 5639:                     free((*s_etat_processus).label_y);
 5640:                     free((*s_etat_processus).label_z);
 5641:                     free((*s_etat_processus).titre);
 5642:                     free((*s_etat_processus).legende);
 5643: 
 5644:                     liberation(s_etat_processus, (*s_etat_processus)
 5645:                             .parametres_courbes_de_niveau);
 5646: 
 5647:                     for(i = 0; i < d_NOMBRE_INTERRUPTIONS; i++)
 5648:                     {
 5649:                         liberation(s_etat_processus,
 5650:                                 (*s_etat_processus).corps_interruptions[i]);
 5651: 
 5652:                         l_element_courant = (*s_etat_processus)
 5653:                                 .pile_origine_interruptions[i];
 5654: 
 5655:                         while(l_element_courant != NULL)
 5656:                         {
 5657:                             l_element_suivant = (*((struct_liste_chainee *)
 5658:                                     l_element_courant)).suivant;
 5659: 
 5660:                             liberation(s_etat_processus,
 5661:                                     (*((struct_liste_chainee *)
 5662:                                     l_element_courant)).donnee);
 5663:                             free(l_element_courant);
 5664: 
 5665:                             l_element_courant = l_element_suivant;
 5666:                         }
 5667:                     }
 5668: 
 5669:                     if ((*s_etat_processus).instruction_derniere_erreur
 5670:                             != NULL)
 5671:                     {
 5672:                         free((*s_etat_processus).instruction_derniere_erreur);
 5673:                         (*s_etat_processus).instruction_derniere_erreur = NULL;
 5674:                     }
 5675: 
 5676:                     /*
 5677:                      * Le pointeur s_etat_processus.nom_fichier_source est
 5678:                      * alloué par le système. Il ne faut donc pas
 5679:                      * le libérer...
 5680:                      */
 5681: 
 5682:                     liberation_arbre_variables_partagees(s_etat_processus,
 5683:                             (*(*s_etat_processus).s_arbre_variables_partagees));
 5684:                     liberation_arbre_variables(s_etat_processus,
 5685:                             (*s_etat_processus).s_arbre_variables, d_vrai);
 5686:                     free((*s_etat_processus).pointeurs_caracteres_variables);
 5687: 
 5688:                     l_element_statique_courant = (*s_etat_processus)
 5689:                             .l_liste_variables_statiques;
 5690: 
 5691:                     while(l_element_statique_courant != NULL)
 5692:                     {
 5693:                         l_element_statique_suivant =
 5694:                             (*l_element_statique_courant).suivant;
 5695:                         free(l_element_statique_courant);
 5696:                         l_element_statique_courant = l_element_statique_suivant;
 5697:                     }
 5698: 
 5699:                     l_element_partage_courant = (*(*s_etat_processus)
 5700:                             .l_liste_variables_partagees);
 5701: 
 5702:                     while(l_element_partage_courant != NULL)
 5703:                     {
 5704:                         l_element_partage_suivant =
 5705:                                 (*l_element_partage_courant).suivant;
 5706:                         free(l_element_partage_courant);
 5707:                         l_element_partage_courant = l_element_partage_suivant;
 5708:                     }
 5709: 
 5710:                     /*
 5711:                      * Si resultats est non nul, rplinit a été appelé
 5712:                      * depuis rpl() [librpl] et non main().
 5713:                      * On copie alors le contenu de la * pile dans un
 5714:                      * tableau **resultats dont le pointeur de base a
 5715:                      * été alloué dans rpl().
 5716:                      */
 5717: 
 5718:                     if (resultats != NULL)
 5719:                     {
 5720:                         if ((*resultats) != NULL)
 5721:                         {
 5722:                             free((*resultats));
 5723: 
 5724:                             if (((*resultats) = malloc(((size_t)
 5725:                                     ((*s_etat_processus)
 5726:                                     .hauteur_pile_operationnelle + 1))
 5727:                                     * sizeof(unsigned char **))) != NULL)
 5728:                             {
 5729:                                 (*resultats)[(*s_etat_processus)
 5730:                                         .hauteur_pile_operationnelle] = NULL;
 5731:                                 l_element_courant = (void *) (*s_etat_processus)
 5732:                                         .l_base_pile;
 5733: 
 5734:                                 for(i = 0; i < (*s_etat_processus)
 5735:                                         .hauteur_pile_operationnelle; i++)
 5736:                                 {
 5737:                                     if (l_element_courant != NULL)
 5738:                                     {
 5739:                                         (*resultats)[i] =
 5740:                                                 formateur(s_etat_processus,
 5741:                                                 0, (*((struct_liste_chainee *)
 5742:                                                 l_element_courant)).donnee);
 5743: 
 5744:                                         if ((*resultats)[i] == NULL)
 5745:                                         {
 5746:                                             i = (*s_etat_processus).
 5747:                                                     hauteur_pile_operationnelle;
 5748:                                         }
 5749:                                         else
 5750:                                         {
 5751:                                             l_element_suivant =
 5752:                                                     (*((struct_liste_chainee *)
 5753:                                                     l_element_courant)).suivant;
 5754:                                         }
 5755:                                     }
 5756:                                 }
 5757:                             }
 5758:                             else
 5759:                             {
 5760:                                 (*resultats) = NULL;
 5761:                                 erreur = d_es_allocation_memoire;
 5762:                             }
 5763:                         }
 5764:                     }
 5765: 
 5766:                     l_element_courant = (void *) (*s_etat_processus)
 5767:                             .l_base_pile;
 5768:                     while(l_element_courant != NULL)
 5769:                     {
 5770:                         l_element_suivant = (*((struct_liste_chainee *)
 5771:                                 l_element_courant)).suivant;
 5772: 
 5773:                         liberation(s_etat_processus,
 5774:                                 (*((struct_liste_chainee *)
 5775:                                 l_element_courant)).donnee);
 5776:                         free((struct_liste_chainee *) l_element_courant);
 5777: 
 5778:                         l_element_courant = l_element_suivant;
 5779:                     }
 5780: 
 5781:                     l_element_courant = (void *) (*s_etat_processus)
 5782:                             .l_base_pile_contextes;
 5783:                     while(l_element_courant != NULL)
 5784:                     {
 5785:                         l_element_suivant = (*((struct_liste_chainee *)
 5786:                                 l_element_courant)).suivant;
 5787: 
 5788:                         liberation(s_etat_processus,
 5789:                                 (*((struct_liste_chainee *)
 5790:                                 l_element_courant)).donnee);
 5791:                         free((struct_liste_chainee *) l_element_courant);
 5792: 
 5793:                         l_element_courant = l_element_suivant;
 5794:                     }
 5795: 
 5796:                     l_element_courant = (void *) (*s_etat_processus)
 5797:                             .l_base_pile_taille_contextes;
 5798:                     while(l_element_courant != NULL)
 5799:                     {
 5800:                         l_element_suivant = (*((struct_liste_chainee *)
 5801:                                 l_element_courant)).suivant;
 5802: 
 5803:                         liberation(s_etat_processus,
 5804:                                 (*((struct_liste_chainee *)
 5805:                                 l_element_courant)).donnee);
 5806:                         free((struct_liste_chainee *) l_element_courant);
 5807: 
 5808:                         l_element_courant = l_element_suivant;
 5809:                     }
 5810: 
 5811:                     for(i = 0; i < (*s_etat_processus)
 5812:                             .nombre_instructions_externes; i++)
 5813:                     {
 5814:                         free((*s_etat_processus).s_instructions_externes[i]
 5815:                                 .nom);
 5816:                         free((*s_etat_processus).s_instructions_externes[i]
 5817:                                 .nom_bibliotheque);
 5818:                     }
 5819: 
 5820:                     if ((*s_etat_processus).nombre_instructions_externes != 0)
 5821:                     {
 5822:                         free((*s_etat_processus).s_instructions_externes);
 5823:                     }
 5824: 
 5825:                     l_element_courant = (void *) (*s_etat_processus)
 5826:                             .s_bibliotheques;
 5827:                     
 5828:                     while(l_element_courant != NULL)
 5829:                     {
 5830:                         l_element_suivant = (*((struct_liste_chainee *)
 5831:                                 l_element_courant)).suivant;
 5832: 
 5833:                         free((*((struct_bibliotheque *)
 5834:                                 (*((struct_liste_chainee *)
 5835:                                 l_element_courant)).donnee)).nom);
 5836:                         dlclose((*((struct_bibliotheque *)
 5837:                                 (*((struct_liste_chainee *)
 5838:                                 l_element_courant)).donnee)).descripteur);
 5839:                         free((*((struct_liste_chainee *) l_element_courant))
 5840:                                 .donnee);
 5841:                         free(l_element_courant);
 5842: 
 5843:                         l_element_courant = l_element_suivant;
 5844:                     }
 5845: 
 5846:                     l_element_courant = (void *) (*s_etat_processus)
 5847:                             .l_base_pile_last;
 5848:                     while(l_element_courant != NULL)
 5849:                     {
 5850:                         l_element_suivant = (*((struct_liste_chainee *)
 5851:                                 l_element_courant)).suivant;
 5852: 
 5853:                         liberation(s_etat_processus,
 5854:                                 (*((struct_liste_chainee *)
 5855:                                 l_element_courant)).donnee);
 5856:                         free((struct_liste_chainee *) l_element_courant);
 5857: 
 5858:                         l_element_courant = l_element_suivant;
 5859:                     }
 5860: 
 5861:                     l_element_courant = (void *) (*s_etat_processus)
 5862:                             .l_base_pile_systeme;
 5863:                     while(l_element_courant != NULL)
 5864:                     {
 5865:                         l_element_suivant = (*((struct_liste_pile_systeme *)
 5866:                                 l_element_courant)).suivant;
 5867: 
 5868:                         liberation(s_etat_processus,
 5869:                                 (*((struct_liste_pile_systeme *)
 5870:                                 l_element_courant)).indice_boucle);
 5871:                         liberation(s_etat_processus,
 5872:                                 (*((struct_liste_pile_systeme *)
 5873:                                 l_element_courant)).limite_indice_boucle);
 5874:                         liberation(s_etat_processus,
 5875:                                 (*((struct_liste_pile_systeme *)
 5876:                                 l_element_courant)).objet_de_test);
 5877: 
 5878:                         if ((*((struct_liste_pile_systeme *)
 5879:                                 l_element_courant)).nom_variable != NULL)
 5880:                         {
 5881:                             free((*((struct_liste_pile_systeme *)
 5882:                                     l_element_courant)).nom_variable);
 5883:                         }
 5884: 
 5885:                         free((struct_liste_pile_systeme *)
 5886:                                 l_element_courant);
 5887: 
 5888:                         l_element_courant = l_element_suivant;
 5889:                     }
 5890: 
 5891:                     l_element_courant = (void *)
 5892:                             (*s_etat_processus).s_fichiers;
 5893:                     while(l_element_courant != NULL)
 5894:                     {
 5895:                         l_element_suivant = (*((struct_liste_chainee *)
 5896:                                 l_element_courant)).suivant;
 5897: 
 5898:                         fclose((*((struct_descripteur_fichier *)
 5899:                                 (*((struct_liste_chainee *)
 5900:                                 l_element_courant)).donnee))
 5901:                                 .descripteur_c);
 5902: 
 5903:                         if ((*((struct_descripteur_fichier *)
 5904:                                 (*((struct_liste_chainee *)
 5905:                                 l_element_courant)).donnee)).type != 'C')
 5906:                         {
 5907:                             sqlite3_close((*((struct_descripteur_fichier *)
 5908:                                     (*((struct_liste_chainee *)
 5909:                                     l_element_courant)).donnee))
 5910:                                     .descripteur_sqlite);
 5911:                         }
 5912: 
 5913:                         if ((*((struct_descripteur_fichier *)
 5914:                                 (*((struct_liste_chainee *)
 5915:                                 l_element_courant)).donnee))
 5916:                                 .effacement == 'Y')
 5917:                         {
 5918:                             unlink((*((struct_descripteur_fichier *)
 5919:                                     (*((struct_liste_chainee *)
 5920:                                     l_element_courant)).donnee))
 5921:                                     .nom);
 5922:                         }
 5923: 
 5924:                         free((*((struct_descripteur_fichier *)
 5925:                                 (*((struct_liste_chainee *)
 5926:                                 l_element_courant)).donnee)).nom);
 5927:                         free((struct_descripteur_fichier *)
 5928:                                 (*((struct_liste_chainee *)
 5929:                                 l_element_courant)).donnee);
 5930:                         free(l_element_courant);
 5931: 
 5932:                         l_element_courant = l_element_suivant;
 5933:                     }
 5934: 
 5935:                     l_element_courant = (void *)
 5936:                             (*s_etat_processus).s_sockets;
 5937:                     while(l_element_courant != NULL)
 5938:                     {
 5939:                         l_element_suivant = (*((struct_liste_chainee *)
 5940:                                 l_element_courant)).suivant;
 5941: 
 5942:                         if ((*((struct_socket *)
 5943:                                 (*(*((struct_liste_chainee *)
 5944:                                 l_element_courant)).donnee).objet))
 5945:                                 .socket_connectee == d_vrai)
 5946:                         {
 5947:                             shutdown((*((struct_socket *)
 5948:                                     (*(*((struct_liste_chainee *)
 5949:                                     l_element_courant)).donnee).objet))
 5950:                                     .socket, SHUT_RDWR);
 5951:                         }
 5952: 
 5953:                         close((*((struct_socket *)
 5954:                                 (*(*((struct_liste_chainee *)
 5955:                                 l_element_courant)).donnee).objet)).socket);
 5956: 
 5957:                         if ((*((struct_socket *) (*(*((struct_liste_chainee *)
 5958:                                 l_element_courant)).donnee).objet)).effacement
 5959:                                 == 'Y')
 5960:                         {
 5961:                             unlink((*((struct_socket *)
 5962:                                     (*(*((struct_liste_chainee *)
 5963:                                     l_element_courant)).donnee).objet))
 5964:                                     .adresse);
 5965:                         }
 5966: 
 5967:                         liberation(s_etat_processus,
 5968:                                 (*((struct_liste_chainee *)
 5969:                                 l_element_courant)).donnee);
 5970:                         free(l_element_courant);
 5971: 
 5972:                         l_element_courant = l_element_suivant;
 5973:                     }
 5974: 
 5975:                     l_element_courant = (void *)
 5976:                             (*s_etat_processus).s_connecteurs_sql;
 5977:                     while(l_element_courant != NULL)
 5978:                     {
 5979:                         l_element_suivant = (*((struct_liste_chainee *)
 5980:                                 l_element_courant)).suivant;
 5981: 
 5982:                         sqlclose((*((struct_liste_chainee *)
 5983:                                 l_element_courant)).donnee);
 5984:                         liberation(s_etat_processus,
 5985:                                 (*((struct_liste_chainee *)
 5986:                                 l_element_courant)).donnee);
 5987:                         free(l_element_courant);
 5988: 
 5989:                         l_element_courant = l_element_suivant;
 5990:                     }
 5991: 
 5992:                     l_element_courant = (*s_etat_processus).s_marques;
 5993:                     while(l_element_courant != NULL)
 5994:                     {
 5995:                         free((*((struct_marque *) l_element_courant)).label);
 5996:                         free((*((struct_marque *) l_element_courant)).position);
 5997:                         l_element_suivant = (*((struct_marque *)
 5998:                                 l_element_courant)).suivant;
 5999:                         free(l_element_courant);
 6000:                         l_element_courant = l_element_suivant;
 6001:                     }
 6002:                 }
 6003:                 else
 6004:                 {
 6005:                     erreur = d_es_allocation_memoire;
 6006: 
 6007:                     if (test_cfsf(s_etat_processus, 51) == d_faux)
 6008:                     {
 6009:                         printf("%s", ds_beep);
 6010:                     }
 6011: 
 6012:                     if ((*s_etat_processus).langue == 'F')
 6013:                     {
 6014:                         printf("+++Système : Mémoire insuffisante\n");
 6015:                     }
 6016:                     else
 6017:                     {
 6018:                         printf("+++System : Not enough memory\n");
 6019:                     }
 6020:                 }
 6021:             }
 6022: 
 6023:             liberation_allocateur(s_etat_processus);
 6024:         }
 6025: 
 6026:         if (traitement_fichier_temporaire == 'Y')
 6027:         {
 6028:             destruction_fichier(nom_fichier_temporaire);
 6029:             free(nom_fichier_temporaire);
 6030:         }
 6031: 
 6032:         if ((*s_etat_processus).profilage == d_vrai)
 6033:         {
 6034:             ecriture_profil(s_etat_processus);
 6035:             liberation_profil(s_etat_processus);
 6036:         }
 6037:     }
 6038: 
 6039:     closelog();
 6040: 
 6041:     pthread_mutex_destroy(&((*s_etat_processus).protection_liste_mutexes));
 6042: 
 6043:     retrait_thread(s_etat_processus);
 6044: 
 6045:     pthread_mutex_destroy(&((*s_etat_processus).mutex));
 6046:     pthread_mutex_destroy(&((*s_etat_processus).mutex_allocation));
 6047:     pthread_mutex_destroy(&mutex_sections_critiques);
 6048:     pthread_mutex_destroy(&mutex_liste_variables_partagees);
 6049: 
 6050: #   ifndef SEMAPHORES_NOMMES
 6051:     sem_post(&((*s_etat_processus).semaphore_fork));
 6052:     sem_destroy(&((*s_etat_processus).semaphore_fork));
 6053: #   else
 6054:     sem_post((*s_etat_processus).semaphore_fork);
 6055:     sem_destroy3((*s_etat_processus).semaphore_fork, getpid(), pthread_self(),
 6056:             SEM_FORK);
 6057: #   endif
 6058: 
 6059:     free((*s_etat_processus).localisation);
 6060: 
 6061: #   ifndef SEMAPHORES_NOMMES
 6062:     sem_post(&semaphore_gestionnaires_signaux);
 6063:     sem_destroy(&semaphore_gestionnaires_signaux);
 6064: #   else
 6065:     sem_post(semaphore_gestionnaires_signaux);
 6066:     sem_destroy2(semaphore_gestionnaires_signaux, getpid(), SEM_SIGNAUX);
 6067: #   endif
 6068: 
 6069:     destruction_queue_signaux(s_etat_processus);
 6070:     liberation_contexte_cas(s_etat_processus);
 6071: 
 6072:     free((*s_etat_processus).chemin_fichiers_temporaires);
 6073: 
 6074:     if ((*s_etat_processus).requete_redemarrage == d_vrai)
 6075:     {
 6076:         chdir(repertoire_initial);
 6077:         execvp(arg_exec[0], &(arg_exec[0]));
 6078:         erreur = d_erreur;
 6079:     }
 6080: 
 6081:     free(arg_exec);
 6082:     arret_thread_signaux(s_etat_processus);
 6083:     free(s_etat_processus);
 6084: 
 6085: #   ifdef DEBUG_MEMOIRE
 6086:     debug_memoire_verification();
 6087:     analyse_post_mortem();
 6088: #   endif
 6089: 
 6090: #   ifdef HAVE_STACK_OVERFLOW_RECOVERY
 6091:     stackoverflow_deinstall_handler();
 6092: #   endif
 6093: 
 6094: #   ifdef HAVE_SIGSEGV_RECOVERY
 6095:     if (debug == d_faux)
 6096:     {
 6097:         sigsegv_deinstall_handler();
 6098:     }
 6099: #   endif
 6100: 
 6101:     return((erreur == d_absence_erreur) ? EXIT_SUCCESS : EXIT_FAILURE);
 6102: }
 6103: 
 6104: 
 6105: void
 6106: informations(struct_processus *s_etat_processus)
 6107: {
 6108:     printf("\n");
 6109: 
 6110:     if ((*s_etat_processus).langue == 'F')
 6111:     {
 6112:         printf("  rpl [-options] [programme]\n");
 6113:         printf("      -a : analyse du code\n");
 6114:         printf("      -A : paramètres passés au programme principal\n");
 6115:         printf("      -c : génération de fichier de débogage (rpl-core)\n");
 6116:         printf("      -d : option de déverminage interne\n");
 6117:         printf("      -D : lancement d'un daemon\n");
 6118:         printf("      -h : aide sur la ligne de commande\n");
 6119:         printf("      -i : fonctionnement interactif\n");
 6120:         printf("      -l : licence d'utilisation\n");
 6121:         printf("      -n : ignorance du signal HUP\n");
 6122:         printf("      -p : précompilation du script avant exécution\n");
 6123:         printf("      -P : profilage (-P ou -PP)\n");
 6124:         printf("      -s : empêchement de l'ouverture de l'écran initial\n");
 6125:         printf("      -S : exécution du script passé en ligne de commande\n");
 6126:         printf("      -t : trace\n");
 6127:         printf("      -v : version\n");
 6128:     }
 6129:     else
 6130:     {
 6131:         printf("  rpl [-options] [program]\n");
 6132:         printf("      -a : analyzes program\n");
 6133:         printf("      -A : sends parameters to main program\n");
 6134:         printf("      -c : allows creation of a rpl-core file, providing a way"
 6135:                 "\n"
 6136:                 "           to debug a program\n");
 6137:         printf("      -d : internal debug process\n");
 6138:         printf("      -D : starts in daemon mode\n");
 6139:         printf("      -h : shows a summary of available options\n");
 6140:         printf("      -i : runs the RPL/2 sequencer in interactive mode\n");
 6141:         printf("      -l : prints the user licence of the software\n");
 6142:         printf("      -n : ignores HUP signal\n");
 6143:         printf("      -p : precompiles script\n");
 6144:         printf("      -P : computes profile data (-P or -PP)\n");
 6145:         printf("      -s : disables splash screen\n");
 6146:         printf("      -S : executes script written in command line\n");
 6147:         printf("      -t : enables tracing mode\n");
 6148:         printf("      -v : prints the version number\n");
 6149:     }
 6150: 
 6151:     printf("\n");
 6152: 
 6153:     return;
 6154: }
 6155: 
 6156: 
 6157: logical1
 6158: controle_integrite(struct_processus *s_etat_processus,
 6159:         unsigned char *executable_candidat, unsigned char *executable)
 6160: {
 6161:     unsigned char       *md5;
 6162:     unsigned char       *sha1;
 6163: 
 6164:     if (strcmp(executable, "rplpp") == 0)
 6165:     {
 6166:         md5 = rplpp_md5;
 6167:         sha1 = rplpp_sha1;
 6168:     }
 6169:     else if (strcmp(executable, "rplfile") == 0)
 6170:     {
 6171:         md5 = rplfile_md5;
 6172:         sha1 = rplfile_sha1;
 6173:     }
 6174:     else if (strcmp(executable, "rpliconv") == 0)
 6175:     {
 6176:         md5 = rpliconv_md5;
 6177:         sha1 = rpliconv_sha1;
 6178:     }
 6179:     else if (strcmp(executable, "rplawk") == 0)
 6180:     {
 6181:         md5 = rplawk_md5;
 6182:         sha1 = rplawk_sha1;
 6183:     }
 6184:     else if (strcmp(executable, "rplconvert") == 0)
 6185:     {
 6186:         md5 = rplconvert_md5;
 6187:         sha1 = rplconvert_sha1;
 6188:     }
 6189:     else
 6190:     {
 6191:         return(d_faux);
 6192:     }
 6193: 
 6194:     if (controle(s_etat_processus, executable_candidat, "md5", md5) != d_vrai)
 6195:     {
 6196:         return(d_faux);
 6197:     }
 6198: 
 6199:     if (controle(s_etat_processus, executable_candidat, "sha1", sha1) != d_vrai)
 6200:     {
 6201:         return(d_faux);
 6202:     }
 6203: 
 6204:     return(d_vrai);
 6205: }
 6206: 
 6207: 
 6208: unsigned char *
 6209: date_compilation()
 6210: {
 6211:     unsigned char       *date;
 6212: 
 6213:     if ((date = malloc((strlen(d_date_en_rpl) + 1) * sizeof(unsigned char)))
 6214:             == NULL)
 6215:     {
 6216:         return(NULL);
 6217:     }
 6218: 
 6219:     strcpy(date, d_date_en_rpl);
 6220: 
 6221:     return(date);
 6222: }
 6223: 
 6224: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>