File:  [local] / rpl / src / rpl.c
Revision 1.145: download - view: text, annotated - select for diffs - revision graph
Tue May 28 22:09:56 2013 UTC (10 years, 11 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Corrections de mutexes... Suite et presque fin.

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

CVSweb interface <joel.bertrand@systella.fr>