File:  [local] / rpl / src / rpl.h
Revision 1.58: download - view: text, annotated - select for diffs - revision graph
Tue Aug 17 14:15:20 2010 UTC (13 years, 8 months ago) by bertrand
Branches: MAIN
CVS tags: HEAD
Correction du patch pour les systèmes sans structure SIGINFO.

    1: /*
    2: ================================================================================
    3:   RPL/2 (R) version 4.0.18
    4:   Copyright (C) 1989-2010 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: #ifndef INCLUSION_RPL
   24: #define INCLUSION_RPL
   25: 
   26: #define _GNU_SOURCE
   27: #define _POSIX_C_SOURCE     200112L
   28: #define _REENTRANT
   29: 
   30: #ifdef Darwin
   31: #   define  _DARWIN_C_SOURCE
   32: #endif
   33: 
   34: #ifdef OpenBSD
   35: #   define _BSD_SOURCE
   36: #endif
   37: 
   38: #ifdef OS2
   39: #   define _BSD_SOURCE
   40: #   define _XOPEN_SOURCE    600
   41: 
   42: #   include <types.h>
   43:     enum { SHUT_RD = 0, SHUT_WR, SHUT_RDWR };
   44: #   define SHUT_RD      SHUT_RD
   45: #   define SHUT_WR      SHUT_WR
   46: #   define SHUT_RDWR    SHUT_RDWR
   47: 
   48: #   include "getaddrinfo-conv.h"
   49: 
   50: #   define sched_yield(arg)
   51: #endif
   52: 
   53: 
   54: /*
   55: ================================================================================
   56:   INCLUSIONS
   57: ================================================================================
   58: */
   59: 
   60: #include <stdio.h>
   61: #include <stdlib.h>
   62: #include <math.h>
   63: #include <string.h>
   64: #include <strings.h>
   65: #include <syslog.h>
   66: #include <errno.h>
   67: #include <stdarg.h>
   68: 
   69: #ifndef RPLARGS
   70: #   include <sys/mman.h>
   71: #   include <sys/time.h>
   72: #   include <sys/resource.h>
   73: #   include <sys/select.h>
   74: #   include <sys/socket.h>
   75: #   include <sys/stat.h>
   76: #   include <sys/timeb.h>
   77: #   include <sys/types.h>
   78: #   include <sys/un.h>
   79: #   include <sys/wait.h>
   80: 
   81: #   include <arpa/inet.h>
   82: #   include <netinet/in.h>
   83: #   include <netdb.h>
   84: 
   85: #   include <dlfcn.h>
   86: #   include <fcntl.h>
   87: #   include <pthread.h>
   88: 
   89: #   ifdef OS2
   90: #       undef pthread_mutexattr_settype
   91: #       define pthread_mutexattr_settype(a, b)
   92: #   endif
   93: 
   94: #   include <pwd.h>
   95: 
   96: #   ifdef _BROKEN_SIGINFO
   97: #       include <sys/ipc.h>
   98: #       include <sys/shm.h>
   99: #   endif
  100: 
  101: #   ifndef SEMAPHORES_SYSV
  102: #       include <semaphore.h>
  103: #   else
  104: #       ifdef OS2
  105: #           define INCL_DOSSEMAPHORES
  106: #           define INCL_DOSMEMMGR
  107: #           define INCL_DOSERRORS
  108: #           include <os2.h>
  109: 
  110:             typedef struct _OS2SEM
  111:             {
  112:                 HMTX    hmtx;
  113:                 HEV     hev;
  114:                 ULONG   shared;
  115:                 ULONG   *cnt;
  116:                 ULONG   *nopened;
  117:                 ULONG   allocated;
  118:             } sem_t;
  119: #       else
  120: #           include <sys/ipc.h>
  121: #           include <sys/sem.h>
  122:             typedef int sem_t;
  123: #       endif
  124: 
  125: #       define SEM_FAILED   NULL
  126: 
  127:         sem_t *sem_open_SysV(const char *nom, int oflag, ...);
  128:         int sem_init_SysV(sem_t *sem, int shared, unsigned int value);
  129:         int sem_close_SysV(sem_t *sem);
  130:         int sem_wait_SysV(sem_t *sem);
  131:         int sem_trywait_SysV(sem_t *sem);
  132:         int sem_post_SysV(sem_t *sem);
  133:         int sem_getvalue_SysV(sem_t *sem, int *value);
  134:         int sem_unlink_SysV(const char *nom);
  135:         int sem_destroy_SysV(sem_t *sem);
  136: #   endif
  137: 
  138: #   include <setjmp.h>
  139: #   include <signal.h>
  140: #   include <termios.h>
  141: #   include <time.h>
  142: #   include <unistd.h>
  143: #   include <locale.h>
  144: 
  145: #   include "history.h"
  146: #   include "readline.h"
  147: #   include "termcap.h"
  148: #   include "iconv.h"
  149: 
  150: #   include "openssl/evp.h"
  151: #   include "sqlite3.h"
  152: 
  153: #   define HAVE_INLINE
  154: #   define GSL_RANGE_CHECK_OFF
  155: #   include "gsl/gsl_cdf.h"
  156: #   include "gsl/gsl_cblas.h"
  157: #   include "gsl/gsl_errno.h"
  158: #   include "gsl/gsl_fft_complex.h"
  159: #   include "gsl/gsl_permutation.h"
  160: #   include "gsl/gsl_randist.h"
  161: #   include "gsl/gsl_rng.h"
  162: #   include "gsl/gsl_sf.h"
  163: #endif
  164: 
  165: #ifdef SunOS
  166: #   include <ieeefp.h>
  167: #endif
  168: 
  169: // Définition spécifique à Hurd
  170: #ifndef PIPE_BUF
  171: #   define fpathconf (".", _PC_PIPE_BUF)
  172: #endif
  173: 
  174: #ifdef MYSQL_SUPPORT
  175: #   include <mysql.h>
  176: #   define mysqlclose(arg)      mysql_close(arg.mysql)
  177: #else
  178: #   define mysqlclose(arg)
  179: #endif
  180: 
  181: #ifdef POSTGRESQL_SUPPORT
  182: #   include <libpq-fe.h>
  183: #   define postgresqlclose(arg) PQfinish(arg.postgresql)
  184: #else
  185: #   define postgresqlclose(arg)
  186: #endif
  187: 
  188: #include "librplprototypes.h"
  189: 
  190: #ifndef UNIX_PATH_MAX
  191:     struct sockaddr_un sizecheck;
  192: #   define UNIX_PATH_MAX sizeof(sizecheck.sun_path)
  193: #endif
  194: 
  195: #ifdef _BROKEN_SIGINFO
  196: #   define SIGHANDLER_ARGS  int signal
  197: #   ifdef SA_SIGINFO
  198: #       undef SA_SIGINFO
  199: #   endif
  200: #   define SA_SIGINFO   0
  201: 
  202: #   define kill(pid, signal)            rpl_kill(pid, signal)
  203: #   define pthread_kill(tid, signal)    rpl_pthread_kill(tid, signal)
  204:     int rpl_kill(pid_t pid, int signal);
  205:     int rpl_pthread_kill(pthread_t tid, int signal);
  206: #else
  207: #   define SIGHANDLER_ARGS  int signal, siginfo_t *siginfo, void *context
  208: #endif
  209: 
  210: #define ftok(path, proj) \
  211:     ({ \
  212:         key_t           key; \
  213:         struct stat     s; \
  214:         while(stat(path, &s) != 0); \
  215:         errno = 0; \
  216:         key = ftok(path, proj); \
  217:         if (key != -1) \
  218:             key |= ((((key_t) s.st_dev) & 0xFF) << 8) | \
  219:                     ((((key_t) s.st_ino) & 0xFFFF) << 16); \
  220:         key; \
  221:     })
  222: 
  223: /*
  224: ================================================================================
  225:   SÉMAPHORES
  226: ================================================================================
  227: */
  228: 
  229: #ifdef SEMAPHORES_SYSV
  230: #   define sem_init(a, b, c)    sem_init_SysV(a, b, c)
  231: #   define sem_destroy(a)       sem_destroy_SysV(a)
  232: #   define sem_wait(a)          sem_wait_SysV(a)
  233: #   define sem_trywait(a)       sem_trywait_SysV(a)
  234: #   define sem_post(a)          sem_post_SysV(a)
  235: #   define sem_getvalue(a, b)   sem_getvalue_SysV(a, b)
  236: #   define sem_open(...)        sem_open_SysV(__VA_ARGS__)
  237: #   define sem_close(a)         sem_close_SysV(a)
  238: #   define sem_unlink(a)        sem_unlink_SysV(a)
  239: #endif
  240: 
  241: 
  242: /*
  243: ================================================================================
  244:   SIGNAUX
  245: ================================================================================
  246: */
  247: 
  248: #ifndef RPLARGS
  249: 
  250: // Signaux utilisés par défaut :
  251: //  SIGINT
  252: //  SIGTSTP
  253: //  SIGCONT
  254: //  SIGURG
  255: //  SIGPIPE
  256: //  SIGALRM
  257: 
  258: //  Arrêt par STOP
  259: #   define SIGFSTOP                 SIGUSR1
  260: //  Démarrage d'un processus fils
  261: #   define SIGSTART                 SIGUSR2
  262: //  Injection de données
  263: #   define SIGINJECT                SIGQUIT
  264: //  Arrêt général
  265: #   ifndef OpenBSD
  266: //  La libpthread d'OpenBSD utilise SIGPROF
  267: #       define SIGABORT             SIGPROF
  268: #   else
  269: #       define SIGABORT             SIGTHR
  270: #   endif
  271: //  Arrêt d'un processus fils depuis autre chose que STOP
  272: #   if defined(Darwin) || defined(OpenBSD)
  273: #       define SIGFABORT            SIGINFO
  274: #   else
  275: #       define SIGFABORT            SIGPOLL
  276: #   endif
  277: 
  278: //  Nombre d'interruptions disponibles
  279: #   define d_NOMBRE_INTERRUPTIONS   64
  280: #endif
  281: 
  282: /*
  283: ================================================================================
  284:   Granularité temporelle
  285: ================================================================================
  286: */
  287: 
  288: #ifndef RPLARGS
  289: #   define GRANULARITE_us           10
  290: #   define GRANULARITE_us_max       100000
  291: #   define INCR_GRANULARITE(g) \
  292:     do  g = 1000 * ((g >= (GRANULARITE_us_max * 1000)) \
  293:             ? GRANULARITE_us_max : ((g / 1000) + GRANULARITE_us)); while(0)
  294: #endif
  295: 
  296: /*
  297: ================================================================================
  298:   Options de debug
  299: ================================================================================
  300: */
  301: 
  302: #ifndef RPLARGS
  303: #   define d_debug_pile_utilisateur         ((integer8) 0x1)
  304: #   define d_debug_pile_systeme             ((integer8) 0x2)
  305: #   define d_debug_appels_fonctions         ((integer8) 0x4)
  306: #   define d_debug_processus                ((integer8) 0x8)
  307: #   define d_debug_analyse                  ((integer8) 0x10)
  308: #   define d_debug_fusible                  ((integer8) 0x20)
  309: #   define d_debug_variables                ((integer8) 0x40)
  310: #   define d_debug_fonctions_intrinseques   ((integer8) 0x80)
  311: #   define d_debug_niveaux                  ((integer8) 0x100)
  312: #   define d_conversion_RPN                 ((integer8) 0x200)
  313: #   define d_traitement_interruption        ((integer8) 0x400)
  314: #   define d_debug_signaux                  ((integer8) 0x800)
  315: #endif
  316: 
  317: /*
  318: ================================================================================
  319:   TYPES
  320: ================================================================================
  321: */
  322: 
  323: typedef FILE                    file;
  324: typedef unsigned char           t_8_bits;
  325: 
  326: #ifndef RPLARGS
  327: #   include "rpltypes-conv.h"
  328: #else
  329: #   include "rpltypes.h"
  330: #endif
  331: 
  332: /*
  333: ================================================================================
  334:   Variables globales
  335: ================================================================================
  336: */
  337: 
  338: #ifndef RPLARGS
  339: #   ifdef SEMAPHORES_NOMMES
  340: #       define LONGUEUR_NOM_SEMAPHORE   64
  341: #   endif
  342: 
  343: #   ifndef MAIN_RPL
  344: #       ifdef _BROKEN_SIGINFO
  345:             extern int              *fifos_signaux;
  346: #       endif
  347: 
  348:         extern jmp_buf              contexte;
  349:         extern jmp_buf              contexte_initial;
  350: 
  351: #       ifdef SEMAPHORES_NOMMES
  352:         extern pthread_mutex_t      mutex_sem;
  353: #       endif
  354: 
  355:         extern pthread_key_t        semaphore_fork_processus_courant;
  356: 
  357:         extern sem_t
  358: #       ifdef SEMAPHORES_NOMMES
  359:         *
  360: #       endif
  361:                                     semaphore_liste_threads;
  362: 
  363:         extern sem_t
  364: #       ifdef SEMAPHORES_NOMMES
  365:         *
  366: #       endif
  367:                                     semaphore_gestionnaires_signaux;
  368: 
  369:         extern sem_t
  370: #       ifdef SEMAPHORES_NOMMES
  371:         *
  372: #       endif
  373:                                     semaphore_gestionnaires_signaux_atomique;
  374: 
  375: #       ifdef SEMAPHORES_NOMMES
  376:         // 0 -> liste_threads
  377:         // 1 -> gestionnaire_signaux
  378:         // 2 -> gestionnaire_signaux_atomique
  379:         // 3 -> &((*s_etat_processus).semaphore_fork)
  380:             extern unsigned char    noms_semaphores[4][LONGUEUR_NOM_SEMAPHORE];
  381:             extern sem_t            *semaphores_nommes[4];
  382: #       endif
  383: #   else
  384: #       ifdef _BROKEN_SIGINFO
  385:             int                     *fifos_signaux;
  386: #       endif
  387: 
  388:         jmp_buf                     contexte;
  389:         jmp_buf                     contexte_initial;
  390: 
  391: #       ifdef SEMAPHORES_NOMMES
  392:         pthread_mutex_t             mutex_sem = PTHREAD_MUTEX_INITIALIZER;
  393: #       endif
  394: 
  395:         pthread_key_t               semaphore_fork_processus_courant;
  396: 
  397:         sem_t
  398: #       ifdef SEMAPHORES_NOMMES
  399:         *
  400: #       endif
  401:                                     semaphore_liste_threads;
  402: 
  403:         sem_t
  404: #       ifdef SEMAPHORES_NOMMES
  405:         *
  406: #       endif
  407:                                     semaphore_gestionnaires_signaux;
  408: 
  409:         sem_t
  410: #       ifdef SEMAPHORES_NOMMES
  411:         *
  412: #       endif
  413:                                     semaphore_gestionnaires_signaux_atomique;
  414: 
  415: #       ifdef SEMAPHORES_NOMMES
  416:             unsigned char           noms_semaphores[4][LONGUEUR_NOM_SEMAPHORE];
  417:             sem_t                   *semaphores_nommes[4];
  418: #       endif
  419: #   endif
  420: #endif
  421: 
  422: #ifdef SEMAPHORES_NOMMES
  423: enum t_semaphore    { sem_liste_threads = 0,
  424:         sem_gestionnaires_signaux = 1,
  425:         sem_gestionnaires_signaux_atomique = 2,
  426:         sem_fork = 3 };
  427: 
  428: sem_t *sem_init2(unsigned int valeur, enum t_semaphore semaphore);
  429: int sem_destroy2(sem_t *semaphore_p, enum t_semaphore semaphore);
  430: int sem_getvalue2(sem_t *semaphore, int *valeur);
  431: 
  432: #define sem_getvalue(semaphore, value) sem_getvalue2(semaphore, value)
  433: #define sem_post(semaphore) \
  434:         ({ int r; pthread_mutex_lock(&mutex_sem); \
  435:         r = sem_post(semaphore), pthread_mutex_unlock(&mutex_sem); r; })
  436: #define sem_wait(semaphore) \
  437:         ({ int r; pthread_mutex_lock(&mutex_sem); \
  438:         r = sem_wait(semaphore), pthread_mutex_unlock(&mutex_sem); r; })
  439: #define sem_trywait(semaphore) \
  440:         ({ int r; pthread_mutex_lock(&mutex_sem); \
  441:         r = sem_trywait(semaphore), pthread_mutex_unlock(&mutex_sem); r; })
  442: #endif
  443: 
  444: /*
  445: ================================================================================
  446:   Macros
  447: ================================================================================
  448: */
  449: 
  450: // Par défaut, tout est redirigé vers stderr sauf indication explicite de
  451: // stdout.
  452: 
  453: #define printf(...) transliterated_fprintf(s_etat_processus, \
  454:             stderr, __VA_ARGS__)
  455: #define fprintf(flux, ...) transliterated_fprintf(s_etat_processus, \
  456:             flux, __VA_ARGS__)
  457: #define uprintf(...) transliterated_fprintf(NULL, \
  458:             stderr, __VA_ARGS__)
  459: #define ufprintf(flux, ...) transliterated_fprintf(NULL, \
  460:             flux, __VA_ARGS__)
  461: 
  462: // Tous les messages pour DISP, INPUT et les E/S par readline sont sur stderr.
  463: // Cela évite aux messages envoyés par les gestionnaires de signaux d'être
  464: // indéfiniment bloqués.
  465: 
  466: #ifdef SunOS
  467: #   define fopen(...) ({ FILE *desc; \
  468:             while((desc = fopen(__VA_ARGS__)) == NULL) \
  469:             { if ((errno != EINTR) && (errno != 0)) break; } desc; })
  470: #   define fclose(...) ({ int ios; \
  471:             while((ios = fclose(__VA_ARGS__)) != 0) \
  472:             { if ((errno != EINTR) && (errno != 0)) break; } ios; })
  473: #   define fread(...) ({ int ios; \
  474:             while((ios = fread(__VA_ARGS__)) < 0) \
  475:             { if ((errno != EINTR) && (errno != 0)) break; } ios; })
  476: #   define fflush(flux) ({ int ios; \
  477:             while((ios = fflush((flux == stdout) ? stderr : flux)) != 0) \
  478:             { if ((errno != EINTR) && (errno != 0)) break; } ios; })
  479: #   define sem_open(...) ({ sem_t *semaphore; \
  480:             while((semaphore = sem_open(__VA_ARGS__)) == SEM_FAILED) \
  481:             { if (errno != EINTR) break; }  semaphore; })
  482: #else // !SunOS
  483: #   define fflush(flux) fflush((flux == stdout) ? stderr : flux)
  484: #endif
  485: 
  486: // Ajout d'un timeout sur les fonctions pipe() pour éviter une erreur
  487: // système dans le cas où l'on a atteint le nombre maximale de fichiers
  488: // ouverts.
  489: 
  490: #define pipe(descripteurs) \
  491:     ({ \
  492:         struct timespec temporisation; \
  493:         int erreur, nombre_echecs; \
  494:         nombre_echecs = 0; \
  495:         do \
  496:         { \
  497:             if ((erreur = pipe(descripteurs)) == 0) break; \
  498:             nombre_echecs++; \
  499:             temporisation.tv_sec = 0; \
  500:             temporisation.tv_nsec = ((long) 1000000000) * rand(); \
  501:             nanosleep(&temporisation, NULL); \
  502:         } while(nombre_echecs < 100); \
  503:         erreur; \
  504:      })
  505: 
  506: // Redéfinition de abs pour un fonctionnement en entier de type long long int
  507: 
  508: #ifdef __GNUC__
  509: #   define abs(i) ({ typeof(i) _i; _i = (i); (_i >= 0) ? _i : -_i; })
  510: // typeof() est une extension de gcc, mais est présent sur d'autres compilateurs
  511: // comme Sun Studio. Dans le cas où typeof() n'existe pas, il est possible
  512: // d'utiliser la macro suivante, mais elle possède un effet de bord dû à
  513: // l'évaluation multiple de l'argument.
  514: #else
  515: #   define abs(i) (((i) >= 0) ? (i) : (-i))
  516: #endif
  517: 
  518: #define NOTICE(m) \
  519:     do \
  520:     { \
  521:         ufprintf(stderr, "[%d-%llu] %s() from %s at line %d: %s\n", \
  522:                 getpid(), (unsigned long long) pthread_self(), \
  523:                 __FUNCTION__, __FILE__, __LINE__, m); \
  524:         fflush(stderr); \
  525:     } while(0)
  526: 
  527: #ifdef __GLIBC__
  528: #include <execinfo.h>
  529: #define __BACKTRACE
  530: #define BACKTRACE(n) \
  531:     do \
  532:     { \
  533:         void            *buffer[n]; \
  534:         int             nb, i; \
  535:         char            **appels; \
  536:         pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; \
  537:         nb = backtrace(buffer, n); \
  538:         appels = backtrace_symbols(buffer, nb); \
  539:         pthread_mutex_lock(&mutex); \
  540:         uprintf("[%d-%llu] BACKTRACE <%s()> at line #%d\n", \
  541:                 getpid(), pthread_self(), __FUNCTION__, __LINE__); \
  542:         if (appels != NULL) \
  543:         { \
  544:             for(i = 0; i < nb; i++) \
  545:                 uprintf("    %s\n", appels[i]); \
  546:             free(appels); \
  547:         } \
  548:         else \
  549:             uprintf("Nullified backtrace\n"); \
  550:         uprintf("[%d-%llu] END OF BACKTRACE\n", getpid(), pthread_self()); \
  551:         fflush(stdout); \
  552:         pthread_mutex_unlock(&mutex); \
  553:     } while(0)
  554: #else
  555: #define BACKTRACE(n) NOTICE("BACKTRACE only defined in glibc")
  556: #endif
  557: 
  558: #ifdef __BACKTRACE
  559: #   define BUG(b, ...) \
  560:             do { if (b) { uprintf("[%d] BUG! <%s()> at line #%d of %s\n", \
  561:             (int) getpid(), __FUNCTION__, __LINE__, __FILE__); \
  562:             __VA_ARGS__; fflush(stdout); \
  563:             BACKTRACE(64); \
  564:             pthread_kill(pthread_self(), SIGBUS); }} while(0)
  565: #else
  566: #   define BUG(b, ...) \
  567:             do { if (b) { uprintf("[%d] BUG! <%s()> at line #%d of %s\n", \
  568:             (int) getpid(), __FUNCTION__, __LINE__, __FILE__); \
  569:             __VA_ARGS__; fflush(stdout); \
  570:             pthread_kill(pthread_self(), SIGBUS); }} while(0)
  571: #endif
  572: 
  573: 
  574: /*
  575: ================================================================================
  576:   Affichage des points de retour des fonctions
  577: ================================================================================
  578: */
  579: 
  580: #ifdef DEBUG_MEMOIRE
  581: void analyse_post_mortem();
  582: void *debug_memoire_ajout(size_t taille, const unsigned char *fonction,
  583:         unsigned long ligne, const unsigned char *argument);
  584: void debug_memoire_initialisation();
  585: void *debug_memoire_modification(void *pointeur, size_t taille,
  586:         const unsigned char *fonction, unsigned long ligne,
  587:         const unsigned char *argument);
  588: void debug_memoire_retrait(void *ptr);
  589: void debug_memoire_verification();
  590: 
  591: pid_t debug_fork();
  592: 
  593: #define malloc(s) debug_memoire_ajout(s, __FUNCTION__, __LINE__, #s)
  594: #define free(s) debug_memoire_retrait(s)
  595: #define realloc(s, t) debug_memoire_modification(s, t, \
  596:             __FUNCTION__, __LINE__, #t)
  597: #define fork() debug_fork()
  598: #endif
  599: 
  600: #ifdef DEBUG_RETURN
  601: #define return uprintf("[%d] Return from <%s()> at line #%d " \
  602:         "(%s [%d])\n", (int) getpid(), __FUNCTION__, \
  603:         __LINE__, strerror(errno), errno); fflush(stdout); errno = 0; return
  604: #endif
  605: 
  606: #ifdef DEBUG_MUTEX
  607: #define pthread_mutex_lock(mutex) uprintf("[%d-%llu] Mutex %s (%p) " \
  608:         "locking at %s() " \
  609:         "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \
  610:         #mutex, mutex, __FUNCTION__, __LINE__), fflush(stdout), \
  611:         pthread_mutex_lock(mutex)
  612: #define pthread_mutex_unlock(mutex) uprintf("[%d-%llu] Mutex %s (%p) " \
  613:         "unlocking at " \
  614:         "%s() line #%d\n", (int) getpid(), (unsigned long long) \
  615:         pthread_self(), #mutex, mutex, __FUNCTION__, __LINE__), \
  616:         fflush(stdout), \
  617:         pthread_mutex_unlock(mutex)
  618: #endif
  619: 
  620: #ifdef DEBUG_SEMAPHORES
  621: #define sem_wait(a) ({ int value; sem_getvalue(a, &value); \
  622:         uprintf("[%d-%llu] Semaphore %s (%p) "\
  623:         "waiting at %s() " \
  624:         "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \
  625:         #a, a, __FUNCTION__, __LINE__), fflush(stdout); \
  626:         if (value > 1) BUG(1, uprintf("Value %d\n", value)); sem_wait(a); })
  627: #define sem_post(a) ({ int value; sem_getvalue(a, &value); \
  628:         uprintf("[%d-%llu] Semaphore %s (%p) "\
  629:         "posting at %s() " \
  630:         "line #%d\n", (int) getpid(), (unsigned long long) pthread_self(), \
  631:         #a, a, __FUNCTION__, __LINE__), fflush(stdout); \
  632:         if (value > 0) BUG(1, uprintf("Value %d\n", value)); sem_post(a); })
  633: #define sem_destroy(a) ({ int value; sem_getvalue(a, &value); \
  634:         if (value == 0) BUG(1, uprintf("Value %d\n", value)); sem_destroy(a); })
  635: #endif
  636: 
  637: 
  638: /*
  639: ================================================================================
  640:   DEFINIONS
  641: ================================================================================
  642: */
  643: 
  644: /*
  645: --------------------------------------------------------------------------------
  646:   Valeurs
  647: --------------------------------------------------------------------------------
  648: */
  649: 
  650: #define d_faux                  ((logical1) 0L)
  651: #define d_vrai                  ((logical1) -1L)
  652: 
  653: #define d_absence_erreur        ((logical1) d_faux)
  654: #define d_erreur                ((logical1) d_vrai)
  655: 
  656: #define d_code_fin_chaine                   '\0'
  657: #define d_code_espace                       ' '
  658: #define d_code_retour_chariot               '\n'
  659: #define d_code_tabulation                   '\t'
  660: #define d_longueur_maximale_instruction     16
  661: 
  662: #define d_INT                   "integer"
  663: #define d_REL                   "real"
  664: #define d_CPL                   "complex"
  665: #define d_VIN                   "[ integer ]"
  666: #define d_VRL                   "[ real ]"
  667: #define d_VCX                   "[ complex ]"
  668: #define d_MIN                   "[[ integer ]]"
  669: #define d_MRL                   "[[ real ]]"
  670: #define d_MCX                   "[[ complex ]]"
  671: #define d_BIN                   "# binary[bodh]"
  672: #define d_NOM                   "'name'"
  673: #define d_CHN                   "\"string\""
  674: #define d_LST                   "{ list }"
  675: #define d_ALG                   "'algebraic'"
  676: #define d_RPN                   "<< RPN >>"
  677: #define d_FCH                   "File $n { format }"
  678: #define d_SLB                   "Library $n"
  679: #define d_SQL                   "Sql $n (type)"
  680: #define d_PRC                   "Process $n"
  681: #define d_SCK                   "Socket $n { format }"
  682: #define d_SPH                   "Semaphore $n 'name'"
  683: #define d_TAB                   "<[ table ]>"
  684: #define d_MTX                   "Mutex $n"
  685: 
  686: /*
  687: --------------------------------------------------------------------------------
  688:   Paramètres du système
  689: --------------------------------------------------------------------------------
  690: */
  691: 
  692: #ifndef RPLARGS
  693: #   define ds_beep                              ""
  694: #   define ds_fichier_historique                ".RPL2_history"
  695: #   define ds_imposition_separateur_decimal     d_vrai
  696: #   define ds_longueur_historique               256
  697: #   define ds_nombre_maximum_fichiers_ouverts   65536
  698: #   define ds_preprocesseur                     "rplpp " \
  699:                                                     "--nostdinc -C 2> /dev/null"
  700: #   define ds_rplcore                           "rpl-core"
  701: #   define ds_rplprofile                        "rpl-profile"
  702: #   define ds_sdat                              "SDAT"
  703: #endif
  704: 
  705: /*
  706: --------------------------------------------------------------------------------
  707:   Erreurs système
  708: --------------------------------------------------------------------------------
  709: */
  710: 
  711: #ifdef DEBUG_ERREURS
  712: #   ifdef MESSAGES
  713: #       define __erreur(i)  i
  714: #   else
  715: #       define __erreur(i)  ({ if (strstr(__FUNCTION__, "recherche_variable") \
  716:                 == NULL) ufprintf(stderr, "ERROR %d AT %s() LINE %d\n", \
  717:                 i, __FUNCTION__, __LINE__); i; })
  718: #   endif
  719: #else
  720: #   define __erreur(i)  i
  721: #endif
  722: 
  723: 
  724: // -1 : erreur provoquée par une bibliothèque externe
  725: #ifndef RPLARGS
  726: #   define d_es                                 2000
  727: #   define d_es_allocation_memoire              __erreur(2001)
  728: #   define d_es_variable_introuvable            __erreur(2002)
  729: #   define d_es_pile_vide                       __erreur(2003)
  730: #   define d_es_end_incoherent                  __erreur(2004)
  731: #   define d_es_peripherique_stdin              __erreur(2005)
  732: #   define d_es_erreur_fichier                  __erreur(2006)
  733: #   define d_es_execution_bibliotheque          __erreur(2007)
  734: #   define d_es_signal                          __erreur(2008)
  735: #   define d_es_processus                       __erreur(2009)
  736: #   define d_es_pile_operationnelle_vide        __erreur(2010)
  737: #   define d_es_nombre_max_descripteurs         __erreur(2011)
  738: #   define d_es_interruption_invalide           __erreur(2012)
  739: #   define d_es_contexte                        __erreur(2013)
  740: #   define d_es_somme_controle                  __erreur(2014)
  741: #endif
  742: 
  743: /*
  744: --------------------------------------------------------------------------------
  745:   Exceptions
  746: --------------------------------------------------------------------------------
  747: */
  748: 
  749: #ifndef RPLARGS
  750: #   define d_ep                                 1000
  751: #   define d_ep_division_par_zero               __erreur(1001)
  752: #   define d_ep_matrice_non_inversible          __erreur(1002)
  753: #   define d_ep_resultat_indefini               __erreur(1003)
  754: #   define d_ep_underflow                       __erreur(1004)
  755: #   define d_ep_overflow                        __erreur(1005)
  756: #   define d_ep_domaine_definition              __erreur(1006)
  757: #   define d_ep_perte_precision                 __erreur(1007)
  758: #   define d_ep_decomposition_QR                __erreur(1008)
  759: #   define d_ep_matrice_non_definie_positive    __erreur(1009)
  760: #   define d_ep_decomposition_QZ                __erreur(1010)
  761: #   define d_ep_decomposition_SVD               __erreur(1011)
  762: #endif
  763: 
  764: /*
  765: --------------------------------------------------------------------------------
  766:   Erreurs de compilation
  767: --------------------------------------------------------------------------------
  768: */
  769: 
  770: #ifndef RPLARGS
  771: #   define d_ec                                 3000
  772: #   define d_ec_niveau_definition_negatif       __erreur(3001)
  773: #   define d_ec_nom_definition_invalide         __erreur(3002)
  774: #   define d_ec_erreur_boucle_definie           __erreur(3003)
  775: #   define d_ec_erreur_instruction_end          __erreur(3004)
  776: #   define d_ec_erreur_instruction_until        __erreur(3005)
  777: #   define d_ec_source_incoherent               __erreur(3006)
  778: #   define d_ec_erreur_instruction_while        __erreur(3007)
  779: #   define d_ec_erreur_instruction_then         __erreur(3008)
  780: #   define d_ec_erreur_instruction_else         __erreur(3009)
  781: #   define d_ec_erreur_instruction_elseif       __erreur(3010)
  782: #   define d_ec_erreur_instruction_select       __erreur(3011)
  783: #   define d_ec_erreur_instruction_case         __erreur(3012)
  784: #endif
  785: 
  786: /*
  787: --------------------------------------------------------------------------------
  788:   Erreurs à l'exécution
  789: --------------------------------------------------------------------------------
  790: */
  791: 
  792: // -1 : erreur provoquée par une bibliothèque externe
  793: #ifndef RPLARGS
  794: #   define d_ex                                 0
  795: #   define d_ex_pile_vide                       __erreur(1)
  796: #   define d_ex_manque_argument                 __erreur(2)
  797: #   define d_ex_argument_invalide               __erreur(3)
  798: #   define d_ex_erreur_type_argument            __erreur(4)
  799: #   define d_ex_nom_reserve                     __erreur(5)
  800: #   define d_ex_nombre_arguments                __erreur(6)
  801: #   define d_ex_dimensions_invalides            __erreur(7)
  802: #   define d_ex_expression_invalide             __erreur(8)
  803: #   define d_ex_absence_graphique_courant       __erreur(9)
  804: #   define d_ex_erreur_traitement_condition     __erreur(10)
  805: #   define d_ex_erreur_traitement_boucle        __erreur(11)
  806: #   define d_ex_variable_non_definie            __erreur(12)
  807: #   define d_ex_drapeau_inexistant              __erreur(13)
  808: #   define d_ex_nom_invalide                    __erreur(14)
  809: #   define d_ex_element_inexistant              __erreur(15)
  810: #   define d_ex_absence_variable                __erreur(16)
  811: #   define d_ex_erreur_evaluation               __erreur(17)
  812: #   define d_ex_semaphore                       __erreur(18)
  813: #   define d_ex_longueur_fft                    __erreur(19)
  814: #   define d_ex_queue_impression                __erreur(20)
  815: #   define d_ex_type_trace_invalide             __erreur(21)
  816: #   define d_ex_erreur_fichier                  __erreur(22)
  817: #   define d_ex_absence_equation                __erreur(23)
  818: #   define d_ex_erreur_bibliotheque             __erreur(24)
  819: #   define d_ex_execution_bibliotheque          __erreur(25)
  820: #   define d_ex_stop                            __erreur(26)
  821: #   define d_ex_matrice_statistique_invalide    __erreur(27)
  822: #   define d_ex_dimensions_matrice_statistique  __erreur(28)
  823: #   define d_ex_absence_observations            __erreur(29)
  824: #   define d_ex_statistiques_echantillon        __erreur(30)
  825: #   define d_ex_observations_inexistantes       __erreur(31)
  826: #   define d_ex_syntaxe                         __erreur(32)
  827: #   define d_ex_cycle_hors_boucle               __erreur(33)
  828: #   define d_ex_conversion_unite                __erreur(34)
  829: #   define d_ex_erreur_parametre_fichier        __erreur(35)
  830: #   define d_ex_erreur_acces_fichier            __erreur(36)
  831: #   define d_ex_erreur_requete_fichier          __erreur(37)
  832: #   define d_ex_erreur_format_fichier           __erreur(38)
  833: #   define d_ex_fichier_verrouille              __erreur(39)
  834: #   define d_ex_verrou_indefini                 __erreur(40)
  835: #   define d_ex_fin_de_fichier_atteinte         __erreur(41)
  836: #   define d_ex_debut_de_fichier_atteint        __erreur(42)
  837: #   define d_ex_erreur_type_fichier             __erreur(43)
  838: #   define d_ex_fichier_vide                    __erreur(44)
  839: #   define d_ex_dimensions_differentes          __erreur(45)
  840: #   define d_ex_routines_mathematiques          __erreur(46)
  841: #   define d_ex_exit_hors_boucle                __erreur(47)
  842: #   define d_ex_longueur_dft                    __erreur(48)
  843: #   define d_ex_contexte                        __erreur(49)
  844: #   define d_ex_processus                       __erreur(50)
  845: #   define d_ex_image_processus                 __erreur(51)
  846: #   define d_ex_erreur_sql                      __erreur(52)
  847: #   define d_ex_variable_verrouillee            __erreur(53)
  848: #   define d_ex_variable_volatile               __erreur(54)
  849: #   define d_ex_erreur_processus                __erreur(55)
  850: #   define d_ex_erreur_impression               __erreur(56)
  851: #   define d_ex_nombre_arguments_fonction       __erreur(57)
  852: #   define d_ex_fonction_indisponible           __erreur(58)
  853: #   define d_ex_bibliotheque_chargee            __erreur(59)
  854: #   define d_ex_aucun_symbole                   __erreur(60)
  855: #   define d_ex_definition_ambigue              __erreur(61)
  856: #   define d_ex_fichier_hors_contexte           __erreur(62)
  857: #   define d_ex_socket_en_ecoute                __erreur(63)
  858: #   define d_ex_interruption_invalide           __erreur(64)
  859: #   define d_ex_erreur_transcodage              __erreur(65)
  860: #   define d_ex_absence_processus_pere          __erreur(66)
  861: #   define d_ex_creation_variable               __erreur(67)
  862: #   define d_ex_fusible                         __erreur(68)
  863: #   define d_ex_iswi_hors_interruption          __erreur(69)
  864: #   define d_ex_daemon                          __erreur(70)
  865: #   define d_ex_mutex                           __erreur(71)
  866: #   define d_ex_variable_statique_partagee      __erreur(72)
  867: #   define d_ex_variable_partagee               __erreur(73)
  868: #   define d_ex_graphique_memorise              __erreur(74)
  869: #   define d_ex_matrice_non_diagonale           __erreur(75)
  870: #   define d_ex_locales                         __erreur(76)
  871: #   define d_ex_representation                  __erreur(77)
  872: #   define d_ex_erreur_profilage                __erreur(78)
  873: #   define d_ex_enregistrement_inexistant       __erreur(79)
  874: #   define d_ex_clef_inexistante                __erreur(80)
  875: #   define d_ex_nom_implicite                   __erreur(81)
  876: #   define d_ex_version_bibliotheque            __erreur(82)
  877: #endif
  878: 
  879: 
  880: /*
  881: ================================================================================
  882:   STRUCTURES
  883: ================================================================================
  884: */
  885: 
  886: /*
  887: --------------------------------------------------------------------------------
  888:   Structure objet
  889: --------------------------------------------------------------------------------
  890: */
  891: 
  892: #ifdef MIN
  893: #   undef MIN
  894: #endif
  895: 
  896: #ifdef MAX
  897: #   undef MAX
  898: #endif
  899: 
  900: #define ADR __RPL_ADR
  901: #define ALG __RPL_ALG
  902: #define BIN __RPL_BIN
  903: #define CHN __RPL_CHN
  904: #define CPL __RPL_CPL
  905: #define FCH __RPL_FCH
  906: #define FCT __RPL_FCT
  907: #define INT __RPL_INT
  908: #define LST __RPL_LST
  909: #define MCX __RPL_MCX
  910: #define MIN __RPL_MIN
  911: #define MRL __RPL_MRL
  912: #define MTX __RPL_MTX
  913: #define NOM __RPL_NOM
  914: #define NON __RPL_NON
  915: #define PRC __RPL_PRC
  916: #define REL __RPL_REL
  917: #define RPN __RPL_RPN
  918: #define SCK __RPL_SCK
  919: #define SLB __RPL_SLB
  920: #define SPH __RPL_SPH
  921: #define SQL __RPL_SQL
  922: #define TBL __RPL_TBL
  923: #define VCX __RPL_VCX
  924: #define VIN __RPL_VIN
  925: #define VRL __RPL_VRL
  926: 
  927: 
  928: enum t_type     { ADR = 0, ALG, BIN, CHN, CPL, FCH, FCT, INT, LST,
  929:                 MCX, MIN, MRL, MTX, NOM, NON, PRC, REL, RPN, SCK,
  930:                 SLB, SPH, SQL, TBL, VCX, VIN, VRL };
  931: 
  932:     /*
  933:     ADR : adresse sur 32 bits (au moins) non signés (unsigned long)
  934:             Adresse d'une définition à interpréter.
  935: 
  936:     ALG : expression algébrique (struct_liste_chainee *)
  937:             La liste chaînée contient la définition convertie en notation
  938:             polonaise inversée. Ce type diffère du type 'RPN' au niveau
  939:             du format de sortie (notation algébrique).
  940: 
  941:     BIN : entier binaire sur 64 bits (unsigned integer8 *)
  942:             Sans objet.
  943:             Type C/Fortran : unsigned integer8
  944: 
  945:     CHN : chaine de caracteres (character*(*), unsigned char *)
  946:             Sans objet.
  947: 
  948:     CPL : complexe sur 2*64 bits (complex*16, struct_complexe16 *)
  949:             Sans objet.
  950:             Type C/Fortran : complex16
  951: 
  952:     FCH : descripteur de fichier (struct_fichier *).
  953: 
  954:     FCT : déclaration d'une fonction et de son nombre d'arguments
  955:             (struct_fonction *). Ce type n'est nécessaire que dans le
  956:             traitement des types 'ALG' et 'RPN'.
  957: 
  958:     INT : entier sur 64 bits (integer*8, integer8 *)
  959:             Sans objet.
  960:             Type C/Fortran : integer8
  961: 
  962:     LST : liste (struct_liste_chainee *)
  963:             Les objets sont enregistrés sous forme de liste chaînée récursive.
  964:             Cela permet de traiter des tableaux de données hétérogènes de
  965:             grandes dimensions. Le nombre de dimensions maximal est fixé par
  966:             la mémoire de la station.
  967: 
  968:     MCX : matrice de complexes (struct_matrice *)
  969:             Sans objet.
  970: 
  971:     MIN : matrice d'entiers (struct_matrice *)
  972:             Sans objet.
  973: 
  974:     MRL : matrice de reels (struct_matrice *)
  975:             Sans objet.
  976: 
  977:     MTX : mutex (struct_mutex *)
  978:             Sans objet.
  979: 
  980:     NOM : nom de variable (struct_nom *)
  981:             Sans objet.
  982: 
  983:     PRC : processus (struct_processus_fils *)
  984:             Sans objet.
  985: 
  986:     REL : reel sur 64 bits (real*8, real8 *)
  987:             Sans objet.
  988: 
  989:     RPN : definition (struct_liste_chainee *)
  990:             Ce type diffère du type 'ALG' au niveau du format de sortie
  991:             (notation polonaise inversée).
  992: 
  993:     SCK : socket (struct_socket *)
  994: 
  995:     SLB : bibliothèque dynamique partagée (struct_bibliotheque *) 
  996:             Sans objet.
  997: 
  998:     SPH : sémaphore nommé (struct_semaphore *)
  999: 
 1000:     SQL : connecteur sur une base de données SQL (struct_connecteur_sql *)
 1001: 
 1002:     TBL : tableau multidimensionnel d'objets (struct_tableau *).
 1003: 
 1004:     VCX : vecteur de complexes (struct_vecteur *)
 1005:             Sans objet.
 1006: 
 1007:     VIN : vecteur d'entiers (struct_vecteur *)
 1008:             Sans objet.
 1009: 
 1010:     VRL : vecteur de reels (struct_vecteur *)
 1011:             Sans objet.
 1012:     */
 1013: 
 1014: typedef struct objet
 1015: {
 1016:     enum t_type         type;
 1017: 
 1018:     volatile long       nombre_occurrences;
 1019: 
 1020:     pthread_mutex_t     mutex;
 1021: 
 1022:     void                *objet;
 1023: } struct_objet;
 1024: 
 1025: 
 1026: /*
 1027: --------------------------------------------------------------------------------
 1028:   Structure fichier
 1029: --------------------------------------------------------------------------------
 1030: */
 1031: 
 1032: #ifndef RPLARGS
 1033: typedef struct fichier
 1034: {
 1035:     unsigned long               descripteur;
 1036: 
 1037:     unsigned char               acces;          /* S/D/I */
 1038:     unsigned char               binaire;        /* Y/N/F */
 1039:     unsigned char               ouverture;
 1040:     unsigned char               protection;
 1041:     unsigned char               *nom;
 1042: 
 1043:     struct_objet                *format;
 1044: 
 1045:     pid_t                       pid;
 1046:     pthread_t                   tid;
 1047: 
 1048:     integer8                    position_clef;
 1049: } struct_fichier;
 1050: #endif
 1051: 
 1052: 
 1053: /*
 1054: --------------------------------------------------------------------------------
 1055:   Structure mutex
 1056: --------------------------------------------------------------------------------
 1057: */
 1058: 
 1059: #ifndef RPLARGS
 1060: typedef struct rpl_mutex
 1061: {
 1062:     pthread_mutex_t     mutex;
 1063: } struct_mutex;
 1064: #endif
 1065: 
 1066: 
 1067: /*
 1068: --------------------------------------------------------------------------------
 1069:   Structure sémaphore
 1070: --------------------------------------------------------------------------------
 1071: */
 1072: 
 1073: #ifndef RPLARGS
 1074: typedef struct semaphore
 1075: {
 1076:     unsigned char   *nom;
 1077:     sem_t           *semaphore;
 1078: } struct_semaphore;
 1079: #endif
 1080: 
 1081: 
 1082: /*
 1083: --------------------------------------------------------------------------------
 1084:   Structure marque
 1085: --------------------------------------------------------------------------------
 1086: */
 1087: 
 1088: #ifndef RPLARGS
 1089: typedef struct marque
 1090: {
 1091:     unsigned char       *label;
 1092:     unsigned char       *position;
 1093: 
 1094:     struct marque       *suivant;
 1095: } struct_marque;
 1096: #endif
 1097: 
 1098: 
 1099: /*
 1100: --------------------------------------------------------------------------------
 1101:   Structure bibliothèque
 1102: --------------------------------------------------------------------------------
 1103: */
 1104: 
 1105: #ifndef RPLARGS
 1106: typedef struct bibliotheque
 1107: {
 1108:     void                        *descripteur;
 1109: 
 1110:     pid_t                       pid;
 1111:     pthread_t                   tid;
 1112: 
 1113:     unsigned char               *nom;
 1114: } struct_bibliotheque;
 1115: #endif
 1116: 
 1117: 
 1118: /*
 1119: --------------------------------------------------------------------------------
 1120:   Structure descripteur fichier
 1121: --------------------------------------------------------------------------------
 1122: */
 1123: 
 1124: #ifndef RPLARGS
 1125: typedef struct descripteur_fichier
 1126: {
 1127:     unsigned long               identifiant;
 1128: 
 1129:     unsigned char               effacement;
 1130:     unsigned char               type; // C (file *) ou S (sqlite *)
 1131:     unsigned char               *nom;
 1132: 
 1133:     pid_t                       pid;
 1134:     pthread_t                   tid;
 1135: 
 1136:     file                        *descripteur_c;
 1137:     sqlite3                     *descripteur_sqlite;
 1138: } struct_descripteur_fichier;
 1139: #endif
 1140: 
 1141: 
 1142: /*
 1143: --------------------------------------------------------------------------------
 1144:   Structure connecteur SQL
 1145: --------------------------------------------------------------------------------
 1146: */
 1147: 
 1148: #ifndef RPLARGS
 1149: typedef struct connecteur_sql
 1150: {
 1151:     pid_t                       pid;
 1152:     pthread_t                   tid;
 1153: 
 1154:     /*
 1155:      * "MYSQL"
 1156:      * "POSTGRESQL"
 1157:      */
 1158: 
 1159:     unsigned char               *type;
 1160:     unsigned char               *locale;
 1161: 
 1162:     union
 1163:     {
 1164: #       ifdef MYSQL_SUPPORT
 1165:             MYSQL               *mysql;
 1166: #       endif
 1167: #       ifdef POSTGRESQL_SUPPORT
 1168:             PGconn              *postgresql;
 1169: #       endif
 1170:     } descripteur;
 1171: } struct_connecteur_sql;
 1172: #endif
 1173: 
 1174: #define sqlclose(s_objet) \
 1175:     if (strcmp((*((struct_connecteur_sql *) (*s_objet).objet)).type, "MYSQL") \
 1176:             == 0) \
 1177:         mysqlclose((*((struct_connecteur_sql *) (*s_objet).objet)) \
 1178:                 .descripteur); \
 1179:     else if (strcmp((*((struct_connecteur_sql *) (*s_objet).objet)).type, \
 1180:             "POSTGRESQL") == 0) \
 1181:         postgresqlclose((*((struct_connecteur_sql *) (*s_objet).objet)) \
 1182:                 .descripteur); \
 1183:     else \
 1184:         BUG(1, uprintf("SQL type '%s' not allowed!", \
 1185:                 (*((struct_connecteur_sql *) (*s_objet).objet)).type));
 1186: 
 1187: /*
 1188: --------------------------------------------------------------------------------
 1189:   Structure socket
 1190: --------------------------------------------------------------------------------
 1191: */
 1192: 
 1193: #ifndef RPLARGS
 1194: typedef struct socket
 1195: {
 1196:     int                         domaine;
 1197:     int                         socket;
 1198: 
 1199:     pid_t                       pid;
 1200:     pthread_t                   tid;
 1201: 
 1202:     unsigned char               *adresse;
 1203:     unsigned char               *adresse_distante;
 1204:     unsigned char               binaire;
 1205:     unsigned char               socket_en_ecoute;
 1206:     logical1                    socket_connectee;
 1207:     unsigned char               effacement;
 1208:     unsigned char               localisation;
 1209:     unsigned char               protection;
 1210:     unsigned char               type[19 + 1];
 1211: 
 1212:     struct_objet                *format;
 1213: } struct_socket;
 1214: #endif
 1215: 
 1216: /*
 1217: --------------------------------------------------------------------------------
 1218:   Structure liste chaînee
 1219: --------------------------------------------------------------------------------
 1220: */
 1221: 
 1222: typedef struct liste_chainee
 1223: {
 1224:     struct liste_chainee        *suivant;
 1225: 
 1226:     struct_objet                *donnee;
 1227: } struct_liste_chainee; 
 1228: 
 1229: 
 1230: /*
 1231: --------------------------------------------------------------------------------
 1232:   Structure liste profilage
 1233: --------------------------------------------------------------------------------
 1234: */
 1235: 
 1236: typedef struct liste_profilage
 1237: {
 1238:     struct liste_profilage      *suivant;
 1239: 
 1240:     unsigned char               *fonction;
 1241: 
 1242:     struct timeval              dernier_appel;
 1243:     struct timeval              cumul;
 1244: 
 1245:     integer8                    nombre_appels;
 1246: } struct_liste_profilage; 
 1247: 
 1248: typedef struct liste_profilage2
 1249: {
 1250:     struct liste_profilage2     *suivant;
 1251: 
 1252:     unsigned char               *fonction;
 1253: } struct_liste_profilage2; 
 1254: 
 1255: /*
 1256: --------------------------------------------------------------------------------
 1257:   Structure contenant les fichiers graphiques (liste chaînée)
 1258: --------------------------------------------------------------------------------
 1259: */
 1260: 
 1261: #ifndef RPLARLS
 1262: typedef struct fichier_graphique
 1263: {
 1264:     struct fichier_graphique    *suivant;
 1265: 
 1266:     logical1                    presence_axes;
 1267: 
 1268:     unsigned char               *nom;
 1269:     unsigned char               type[21];
 1270: 
 1271:     unsigned char               *legende;
 1272: 
 1273:     int                         dimensions;
 1274: 
 1275:     integer8                    systeme_axes;
 1276: } struct_fichier_graphique;
 1277: #endif
 1278: 
 1279: /*
 1280: --------------------------------------------------------------------------------
 1281:   Structure nom
 1282: --------------------------------------------------------------------------------
 1283: */
 1284: 
 1285: typedef struct nom
 1286: {
 1287:     unsigned char               *nom;
 1288:     logical1                    symbole;    /* d_vrai/d_faux */
 1289:     // symbole == d_vrai signifie que le nom a été introduit dans un
 1290:     // calcul sans les apostrophes.
 1291: } struct_nom;
 1292: 
 1293: 
 1294: /*
 1295: --------------------------------------------------------------------------------
 1296:   Structure processus fils
 1297: --------------------------------------------------------------------------------
 1298: */
 1299: 
 1300: #ifndef RPLARGS
 1301: typedef struct descripteur_thread
 1302: {
 1303:     struct processus            *s_etat_processus;
 1304:     struct processus            *s_nouvel_etat_processus;
 1305: 
 1306:     struct_objet                *argument;
 1307: 
 1308:     pid_t                       pid;
 1309:     volatile pthread_t          tid;
 1310: 
 1311:     pthread_t                   thread_pere;
 1312: 
 1313:     pthread_mutex_t             mutex;
 1314: 
 1315:     volatile logical1           thread_actif;
 1316: 
 1317:     int                         pipe_erreurs[2];
 1318:     int                         pipe_objets[2];
 1319:     int                         pipe_injections[2];
 1320:     int                         pipe_nombre_injections[2];
 1321:     int                         pipe_interruptions[2];
 1322:     int                         pipe_nombre_objets_attente[2];
 1323:     int                         pipe_nombre_interruptions_attente[2];
 1324:     int                         pipe_acquittement[2];
 1325: 
 1326:     volatile integer8           nombre_objets_dans_pipe;
 1327:     volatile integer8           nombre_interruptions_dans_pipe;
 1328: 
 1329:     logical1                    processus_detache;
 1330:     logical1                    destruction_objet;
 1331: 
 1332:     sigset_t                    oldset;
 1333:     sigset_t                    set;
 1334: 
 1335:     volatile signed long        nombre_references;
 1336: } struct_descripteur_thread;
 1337: 
 1338: typedef struct processus_fils
 1339: {
 1340:     struct_descripteur_thread       *thread;
 1341: } struct_processus_fils;
 1342: #endif
 1343: 
 1344: 
 1345: /*
 1346: --------------------------------------------------------------------------------
 1347:   Structure liste pile systeme
 1348: --------------------------------------------------------------------------------
 1349: */
 1350: 
 1351: #ifndef RPLARGS
 1352: typedef struct liste_pile_systeme
 1353: {
 1354:     struct liste_pile_systeme   *suivant;
 1355: 
 1356:     struct_liste_chainee        *pointeur_objet_retour;
 1357: 
 1358:     struct_objet                *indice_boucle;
 1359:     struct_objet                *limite_indice_boucle;
 1360:     struct_objet                *objet_de_test;
 1361: 
 1362:     logical1                    arret_si_exception;
 1363:     logical1                    creation_variables_statiques;
 1364:     logical1                    creation_variables_partagees;
 1365:     logical1                    evaluation_expression;
 1366: 
 1367:     unsigned char               clause;
 1368: 
 1369:     /*
 1370:     clause :
 1371:     I : IF
 1372:     R : IFERR
 1373:     X : IFERR indiquant la présence d'une erreur.
 1374:     T : THEN
 1375:     E : ELSE
 1376:     Z : traitement en cours de ELSE
 1377:     D : DO
 1378:     U : UNTIL
 1379:     W : WHILE
 1380:     M : WHILE avec une clause fausse.
 1381:     S : SELECT
 1382:     K : aucun cas CASE n'a encore été traité.
 1383:     C : au moins un cas de SELECT...CASE a été traité.
 1384:     Q : traitement en cours d'un cas CASE.
 1385:     F : traitement du cas DEFAULT
 1386:     */
 1387: 
 1388:     unsigned char               retour_definition;
 1389:     unsigned char               *nom_variable;
 1390:     unsigned char               origine_routine_evaluation;
 1391:     unsigned char               type_cloture;
 1392: 
 1393:     /*
 1394:     type clôture :
 1395:     C     SELECT  : END termine un test SELECT/DEFAULT/END.
 1396:     D     DO      : END termine une boucle DO/UNTIL/END.
 1397:     I     IF      : END termine un test IF/THEN (ELSE)/END.
 1398:     J     IFERR   : END termine un test IFERR/THEN (ELSE)/END.
 1399:     K     CASE    : END termine un test CASE/THEN/END
 1400:     W     WHILE   : END termine une boucle WHILE/REPEAT/END.
 1401: 
 1402:     F     FOR     : NEXT ou STEP termine une boucle avec compteur.
 1403:     S     START   : NEXT ou STEP termine une boucle sans compteur.
 1404:     L     LOOP    : boucle utilisé dans le traitement de l'instruction RETURN.
 1405:             Elle correspond à une boucle FOR ou START mais sans son
 1406:             initialisation.
 1407:     */
 1408: 
 1409:     unsigned long               adresse_retour;
 1410:     unsigned long               niveau_courant;
 1411:     struct_objet                *pointeur_adresse_retour;
 1412: } struct_liste_pile_systeme;
 1413: #endif
 1414: 
 1415: 
 1416: /*
 1417: --------------------------------------------------------------------------------
 1418:   Structure variable
 1419: --------------------------------------------------------------------------------
 1420: */
 1421: 
 1422: #ifndef RPLARGS
 1423: typedef union position_variable
 1424: {
 1425:     unsigned long       adresse;
 1426:     struct_objet        *pointeur;
 1427: } union_position_variable;
 1428: 
 1429: typedef struct variable
 1430: {
 1431:     unsigned char           *nom;
 1432:     unsigned char           origine;
 1433: 
 1434:     unsigned long           niveau;
 1435: 
 1436:     union_position_variable variable_statique;
 1437:     union_position_variable variable_partagee;
 1438: 
 1439:     struct_objet            *objet;
 1440: 
 1441:     logical1                variable_verrouillee;
 1442: } struct_variable;
 1443: 
 1444: #endif
 1445: 
 1446: /*
 1447: --------------------------------------------------------------------------------
 1448:   Structure variable partagée
 1449: --------------------------------------------------------------------------------
 1450: */
 1451: 
 1452: #ifndef RPLARGS
 1453: 
 1454: typedef struct variable_partage
 1455: {
 1456:     unsigned char               *nom;
 1457:     unsigned char               origine;
 1458: 
 1459:     unsigned long               niveau;
 1460: 
 1461:     union_position_variable     variable_partagee;
 1462: 
 1463:     struct_objet                *objet;
 1464: } struct_variable_partagee;
 1465: 
 1466: typedef struct table_variables_partagees
 1467: {
 1468:     pthread_mutex_t                     mutex;
 1469: 
 1470:     volatile struct_variable_partagee   *table;
 1471: 
 1472:     volatile unsigned long              nombre_variables;
 1473:     volatile unsigned long              nombre_variables_allouees;
 1474: 
 1475:     unsigned long                       position_variable;
 1476: } struct_table_variables_partagees;
 1477: 
 1478: #endif
 1479: 
 1480: 
 1481: /*
 1482: --------------------------------------------------------------------------------
 1483:   Structure variable statique
 1484: --------------------------------------------------------------------------------
 1485: */
 1486: 
 1487: #ifndef RPLARGS
 1488: typedef struct variable_statique
 1489: {
 1490:     unsigned char           *nom;
 1491:     unsigned char           origine;
 1492: 
 1493:     // Position de création de la variable statique dans le programme ou dans
 1494:     // l'expression. 'origine' vaut 'P' pour programme ou 'E' pour expression.
 1495: 
 1496:     unsigned long           niveau;
 1497: 
 1498:     union_position_variable variable_statique;
 1499: 
 1500:     struct_objet            *objet;
 1501: } struct_variable_statique;
 1502: #endif
 1503: 
 1504: 
 1505: /*
 1506: --------------------------------------------------------------------------------
 1507:   Structure vecteur
 1508: --------------------------------------------------------------------------------
 1509: */
 1510: 
 1511: typedef struct vecteur
 1512: {
 1513:     unsigned long       taille;
 1514: 
 1515:     unsigned char       type; /* C (complex*16), R (real*8), I (integer*8) */
 1516: 
 1517:     void                *tableau;
 1518: } struct_vecteur;
 1519: 
 1520: 
 1521: /*
 1522: --------------------------------------------------------------------------------
 1523:   Structure matrice
 1524: --------------------------------------------------------------------------------
 1525: */
 1526: 
 1527: typedef struct matrice
 1528: {
 1529:     unsigned long       nombre_lignes;
 1530:     unsigned long       nombre_colonnes;
 1531: 
 1532:     unsigned char       type; /* C (complex*16), R (real*8), I (integer*8) */
 1533: 
 1534:     void                **tableau;
 1535: } struct_matrice;
 1536: 
 1537: 
 1538: /*
 1539: --------------------------------------------------------------------------------
 1540:   Structure tableau
 1541: --------------------------------------------------------------------------------
 1542: */
 1543: 
 1544: typedef struct tableau
 1545: {
 1546:     unsigned long       nombre_elements;
 1547: 
 1548:     struct_objet        **elements;
 1549: } struct_tableau;
 1550: 
 1551: 
 1552: /*
 1553: --------------------------------------------------------------------------------
 1554:   Structure arbre
 1555: --------------------------------------------------------------------------------
 1556: */
 1557: 
 1558: typedef struct arbre
 1559: {
 1560:     struct_objet        *objet;
 1561: 
 1562:     unsigned long       nombre_feuilles;
 1563:     struct arbre        **feuilles;
 1564: } struct_arbre;
 1565: 
 1566: 
 1567: /*
 1568: --------------------------------------------------------------------------------
 1569:   Structures de gestion des instructions externes
 1570: --------------------------------------------------------------------------------
 1571: */
 1572: 
 1573: typedef struct instruction_externe
 1574: {
 1575:     unsigned char       *nom;
 1576:     unsigned char       *nom_bibliotheque;
 1577:     void                *descripteur_bibliotheque;
 1578: } struct_instruction_externe;
 1579: 
 1580: 
 1581: /*
 1582: --------------------------------------------------------------------------------
 1583:   Structure argument (pour les fonctions dynamiques)
 1584: --------------------------------------------------------------------------------
 1585: */
 1586: 
 1587: typedef struct rpl_arguments
 1588: {
 1589: /* Piles operationnelles                                */
 1590: 
 1591:     struct_liste_chainee        *l_base_pile;
 1592:     struct_liste_chainee        *l_base_pile_last;
 1593: 
 1594: /* Etat du calculateur                                  */
 1595: 
 1596:     t_8_bits                    drapeaux_etat[8];
 1597: 
 1598: /* Traitement des erreurs                               */
 1599: 
 1600:     unsigned char               *message_erreur;
 1601:     unsigned char               type_erreur;            /* S = système
 1602:                                                            E = exécution */
 1603:     integer8                    erreur;
 1604: 
 1605: /* Traitement des messages d'aide                       */
 1606: 
 1607:     logical1                    aide;                   /* Affichage d'un
 1608:                                                            message d'aide
 1609:                                                            par la routine */
 1610: 
 1611: /* Nombre d'arguments                                   */
 1612: 
 1613:     unsigned char               affichage_arguments;
 1614:     unsigned char               constante_symbolique;
 1615:     unsigned char               instruction_valide;
 1616:     unsigned char               test_instruction;
 1617: 
 1618:     integer8                    nombre_arguments;
 1619:     // Nombre d'arguments de la fonction, positif ou nul.
 1620: 
 1621:     void                        *s_etat_processus;
 1622: } struct_rpl_arguments;
 1623: 
 1624: 
 1625: /*
 1626: --------------------------------------------------------------------------------
 1627:   Structure processus
 1628: --------------------------------------------------------------------------------
 1629: */
 1630: 
 1631: #ifndef RPLARGS
 1632: typedef struct processus
 1633: {
 1634: /* Pointeurs sur le programme                           */
 1635: 
 1636:     unsigned char               *definitions_chainees;
 1637:     struct_liste_chainee        *expression_courante;
 1638: 
 1639:     unsigned char               *instruction_courante;
 1640:     struct_objet                *objet_courant;
 1641:     unsigned char               evaluation_expression_compilee;     /*Y/N*/
 1642: 
 1643:     unsigned char               *nom_fichier_source;
 1644:     unsigned char               *nom_fichier_historique;
 1645: 
 1646:     unsigned char               autorisation_conversion_chaine;     /*Y/N*/
 1647:     unsigned char               autorisation_empilement_programme;  /*Y/N*/
 1648:     unsigned char               autorisation_evaluation_nom;        /*Y/N*/
 1649:     unsigned char               autorisation_nom_implicite;         /*Y/N*/
 1650:     unsigned char               evaluation_forcee;                  /*Y/N*/
 1651:     unsigned char               instruction_valide;                 /*Y/N*/
 1652:     unsigned char               instruction_intrinseque;            /*Y/I/N*/
 1653:     unsigned char               test_instruction;                   /*Y/N*/
 1654:     unsigned char               affichage_arguments;                /*Y/N*/
 1655:     unsigned char               constante_symbolique;               /*Y/N*/
 1656:     unsigned char               traitement_symbolique;              /*Y/N*/
 1657:     unsigned char               mode_execution_programme;           /*Y/I/N*/
 1658:     unsigned char               mode_interactif;                    /*Y/N*/
 1659:     unsigned char               mode_evaluation_expression;         /*Y/N*/
 1660:     unsigned char               traitement_cycle_exit;              /*N/E/C*/
 1661: 
 1662:     unsigned long               position_courante;
 1663:     unsigned long               longueur_definitions_chainees;
 1664: 
 1665: /* Pointeurs sur les instructions                       */
 1666: 
 1667:     int                         *pointeurs_caracteres;
 1668:     int                         nombre_caracteres;
 1669:     struct instruction          *arbre_instructions;
 1670: 
 1671: /* Requetes                                             */
 1672: 
 1673:     unsigned char               requete_arret;                      /*Y/N*/
 1674: 
 1675: /* Piles operationnelles                                */
 1676: 
 1677:     struct_liste_chainee        *l_base_pile;
 1678:     struct_liste_chainee        *l_base_pile_last;
 1679: 
 1680:     unsigned long               hauteur_pile_operationnelle;
 1681: 
 1682: /* Piles systemes                                       */
 1683: 
 1684:     struct_liste_pile_systeme   *l_base_pile_systeme;
 1685: 
 1686:     unsigned long               hauteur_pile_systeme;
 1687: 
 1688: /* Gestion des processus                                */
 1689: 
 1690:     volatile
 1691:     struct_liste_chainee        *l_base_pile_processus;
 1692: 
 1693:     logical1                    presence_pipes;
 1694: 
 1695:     int                         pipe_acquittement;
 1696:     int                         pipe_donnees;
 1697:     int                         pipe_injections;
 1698:     int                         pipe_nombre_injections;
 1699:     int                         pipe_interruptions;
 1700:     int                         pipe_nombre_objets_attente;
 1701:     int                         pipe_nombre_interruptions_attente;
 1702:     int                         nombre_objets_envoyes_non_lus;
 1703:     int                         nombre_objets_injectes;
 1704: 
 1705:     real8                       pourcentage_maximal_cpu;
 1706:     real8                       temps_maximal_cpu;
 1707: 
 1708:     logical1                    presence_fusible;
 1709:     pthread_t                   thread_fusible;
 1710:     pthread_t                   thread_surveille_par_fusible;
 1711: 
 1712: #   if !defined(Cygwin)
 1713: #       if !(OpenBSD)
 1714:     stack_t                     pile_signal;
 1715: #       else
 1716: #           ifdef SA_ONSTACK
 1717: #               undef SA_ONSTACK
 1718: #           endif
 1719: #           define SA_ONSTACK   0
 1720: #       endif
 1721: #   else
 1722: #   define SA_ONSTACK           0
 1723: #   define RTLD_LOCAL           0
 1724: #   endif
 1725: 
 1726: /* Contextes                                            */
 1727: 
 1728:     struct_liste_chainee        *l_base_pile_contextes;
 1729:     struct_liste_chainee        *l_base_pile_taille_contextes;
 1730: 
 1731: /* Variables                                            */
 1732: 
 1733:     struct_variable             *s_liste_variables;
 1734:     unsigned long               nombre_variables;
 1735:     unsigned long               nombre_variables_allouees;
 1736: 
 1737:     struct_variable_statique    *s_liste_variables_statiques;
 1738:     unsigned long               nombre_variables_statiques;
 1739:     unsigned long               nombre_variables_statiques_allouees;
 1740: 
 1741:     struct_table_variables_partagees
 1742:                                 *s_liste_variables_partagees;
 1743: 
 1744:     unsigned long               niveau_courant;
 1745:     unsigned long               niveau_initial;
 1746:     unsigned long               position_variable_courante;
 1747:     unsigned long               position_variable_statique_courante;
 1748: 
 1749:     logical1                    creation_variables_statiques;
 1750:     logical1                    creation_variables_partagees;
 1751:     logical1                    gel_liste_variables;
 1752: 
 1753: /* Fichiers                                             */
 1754: 
 1755:     struct_liste_chainee        *s_fichiers;
 1756: 
 1757: /*  Sockets                                             */
 1758: 
 1759:     struct_liste_chainee        *s_sockets;
 1760: 
 1761: /*  Connecteurs aux bases de données                    */
 1762: 
 1763:     struct_liste_chainee        *s_connecteurs_sql;
 1764: 
 1765: /* Bibliothèques dynamiques                             */
 1766: 
 1767:     struct_liste_chainee        *s_bibliotheques;
 1768:     struct_instruction_externe  *s_instructions_externes;
 1769:     unsigned long               nombre_instructions_externes;
 1770: 
 1771: /* Fichier d'impression                                 */
 1772: 
 1773:     unsigned char               *nom_fichier_impression;
 1774:     unsigned char               format_papier[16];
 1775: 
 1776: /* Parametres graphiques                                */
 1777: 
 1778:     struct_fichier_graphique    *fichiers_graphiques;    /* NULL */
 1779: 
 1780:     unsigned char               type_trace_eq[21];
 1781: 
 1782:                                 /*
 1783:                                  * 2D :
 1784:                                  * FONCTION
 1785:                                  * PARAMETRIQUE
 1786:                                  * POLAIRE
 1787:                                  * COURBES DE NIVEAU
 1788:                                  *
 1789:                                  * 3D :
 1790:                                  * GRILLE 3D
 1791:                                  * COURBE PARAMETRIQUE // A FAIRE
 1792:                                  * SURFACE PARAMETRIQUE // A FAIRE
 1793:                                  * CYNLINDRIQUE // A FAIRE
 1794:                                  * SPHERIQUE // A FAIRE
 1795:                                  */
 1796: 
 1797:     unsigned char               type_trace_sigma[21];
 1798: 
 1799:                                 /*
 1800:                                  * POINTS
 1801:                                  * HISTOGRAMME
 1802:                                  * TABLE TRACANTE
 1803:                                  */
 1804: 
 1805:                                 /*
 1806:                                  * ECHELLES
 1807:                                  */
 1808: 
 1809:     integer8                    systeme_axes;
 1810: 
 1811:     real8                       x_min;
 1812:     real8                       x_max;
 1813:     real8                       y_min;
 1814:     real8                       y_max;
 1815:     real8                       z_min;
 1816:     real8                       z_max;
 1817: 
 1818:     real8                       x_tics;
 1819:     real8                       y_tics;
 1820:     real8                       z_tics;
 1821:     
 1822:     integer8                    mx_tics;
 1823:     integer8                    my_tics;
 1824:     integer8                    mz_tics;
 1825: 
 1826:     logical1                    x_lines;
 1827:     logical1                    y_lines;
 1828:     logical1                    z_lines;
 1829: 
 1830:     logical1                    mx_lines;
 1831:     logical1                    my_lines;
 1832:     logical1                    mz_lines;
 1833: 
 1834:                                 /*
 1835:                                  * -1 : absent du graphique
 1836:                                  *  0 : graduations automatiques
 1837:                                  * >0 : valeur manuelle
 1838:                                  */
 1839: 
 1840:     real8                       x2_min;
 1841:     real8                       x2_max;
 1842:     real8                       y2_min;
 1843:     real8                       y2_max;
 1844:     real8                       z2_min;
 1845:     real8                       z2_max;
 1846: 
 1847:     real8                       x2_tics;
 1848:     real8                       y2_tics;
 1849:     real8                       z2_tics;
 1850: 
 1851:     integer8                    mx2_tics;
 1852:     integer8                    my2_tics;
 1853:     integer8                    mz2_tics;
 1854: 
 1855:     logical1                    x2_lines;
 1856:     logical1                    y2_lines;
 1857:     logical1                    z2_lines;
 1858: 
 1859:     logical1                    mx2_lines;
 1860:     logical1                    my2_lines;
 1861:     logical1                    mz2_lines;
 1862: 
 1863:     real8                       resolution;
 1864: 
 1865:     logical1                    souris_active;
 1866: 
 1867:     logical1                    echelle_automatique_x;
 1868:     logical1                    echelle_automatique_y;
 1869:     logical1                    echelle_automatique_z;
 1870: 
 1871:     logical1                    echelle_automatique_x2;
 1872:     logical1                    echelle_automatique_y2;
 1873:     logical1                    echelle_automatique_z2;
 1874: 
 1875:     logical1                    echelle_log_x;
 1876:     logical1                    echelle_log_y;
 1877:     logical1                    echelle_log_z;
 1878: 
 1879:     logical1                    echelle_log_x2;
 1880:     logical1                    echelle_log_y2;
 1881:     logical1                    echelle_log_z2;
 1882: 
 1883:     real8                       point_de_vue_theta;
 1884:     real8                       point_de_vue_phi;
 1885:     real8                       echelle_3D;
 1886: 
 1887:     unsigned char               *label_x;
 1888:     unsigned char               *label_y;
 1889:     unsigned char               *label_z;
 1890:     unsigned char               *titre;
 1891:     unsigned char               *legende;
 1892: 
 1893:     unsigned char               *nom_fichier_gnuplot;
 1894:     unsigned char               *type_fichier_gnuplot;
 1895: 
 1896:     struct_objet                *indep;
 1897:     struct_objet                *depend;
 1898:     struct_objet                *parametres_courbes_de_niveau;
 1899: 
 1900:     struct_marque               *s_marques;
 1901: 
 1902:     file                        *entree_standard;
 1903: 
 1904:     logical1                    requete_nouveau_plan;
 1905:     logical1                    mise_a_jour_trace_requise;
 1906: 
 1907: /* Parametres statistiques                              */
 1908: 
 1909:     integer8                    colonne_statistique_1;
 1910:     integer8                    colonne_statistique_2;
 1911: 
 1912: /* Etat du calculateur                                  */
 1913: 
 1914:     t_8_bits                    drapeaux_etat[8];
 1915: 
 1916: /* Traitement des exceptions                            */
 1917: 
 1918:     logical1                    arret_si_exception;
 1919:     unsigned int                exception;
 1920:     unsigned int                derniere_exception;
 1921:     unsigned int                exception_processus_fils;
 1922: 
 1923: /* Traitement des erreurs                               */
 1924: 
 1925:     unsigned int                erreur_compilation;
 1926:     unsigned int                erreur_execution;
 1927:     unsigned int                erreur_systeme;
 1928: 
 1929:     struct_objet                *s_objet_errone;
 1930:     struct_objet                *s_objet_erreur;
 1931: 
 1932:     logical1                    erreur_scrutation;
 1933: 
 1934:     volatile unsigned int       erreur_systeme_processus_fils;
 1935:     unsigned int                erreur_execution_processus_fils;
 1936: 
 1937:     pid_t                       pid_erreur_processus_fils;
 1938: 
 1939:     logical1                    erreur_processus_fils;
 1940: 
 1941:     integer8                    derniere_erreur_fonction_externe;
 1942: 
 1943:     unsigned int                derniere_erreur_systeme;
 1944:     unsigned int                derniere_erreur_execution;
 1945:     unsigned int                derniere_erreur_evaluation;
 1946: 
 1947:     unsigned char               *instruction_derniere_erreur;
 1948: 
 1949:     unsigned long               niveau_derniere_erreur;
 1950: 
 1951:     logical1                    core;
 1952:     logical1                    invalidation_message_erreur;
 1953: 
 1954: /* Debug                                                */
 1955: 
 1956:     logical1                    debug;
 1957:     integer8                    type_debug;
 1958:     logical1                    debug_programme;
 1959:     logical1                    execution_pas_suivant;
 1960:     logical1                    traitement_instruction_halt;
 1961: 
 1962: /* Interruptions logicielles                            */
 1963: 
 1964:     unsigned char               masque_interruptions[d_NOMBRE_INTERRUPTIONS];
 1965: 
 1966:     /*
 1967:      * 'I' : interruption ignorée
 1968:      * 'Q' : interruption mise en queue pour un traitement ultérieur
 1969:      * 'N' : traitement normal de l'interruption
 1970:      */
 1971: 
 1972:     integer8                    queue_interruptions[d_NOMBRE_INTERRUPTIONS];
 1973:     integer8                    nombre_interruptions_en_queue;
 1974:     struct_liste_chainee        *pile_origine_interruptions
 1975:                                         [d_NOMBRE_INTERRUPTIONS];
 1976:     volatile integer8           nombre_interruptions_non_affectees;
 1977: 
 1978:     struct_objet                *corps_interruptions[d_NOMBRE_INTERRUPTIONS];
 1979: 
 1980:     unsigned char               traitement_interruption;  /* Y/N */
 1981:     unsigned char               traitement_interruptible; /* Y/N */
 1982:     unsigned char               traitement_at_poke;       /* Y/N */
 1983: 
 1984:     struct_objet                *at_exit;
 1985:     struct_objet                *at_poke;
 1986: 
 1987: /* Variables volatiles                                  */
 1988: 
 1989:     volatile sig_atomic_t       var_volatile_alarme;
 1990:     // Traitement de ctrl+C et des arrêts brutaux
 1991:     volatile sig_atomic_t       var_volatile_requete_arret;
 1992:     // Traitement de ctrl+Z
 1993:     volatile sig_atomic_t       var_volatile_requete_arret2;
 1994:     volatile sig_atomic_t       var_volatile_traitement_retarde_stop;
 1995:     volatile sig_atomic_t       var_volatile_traitement_sigint;
 1996: 
 1997:     volatile sig_atomic_t       var_volatile_processus_pere;
 1998:     volatile sig_atomic_t       var_volatile_recursivite;
 1999: 
 2000:     volatile sig_atomic_t       arret_depuis_abort;
 2001: 
 2002:     volatile int                var_volatile_exception_gsl;
 2003: 
 2004: /* Autres                                               */
 2005: 
 2006:     char                        *rpl_home;
 2007: 
 2008:     gsl_rng                     *generateur_aleatoire;
 2009:     const gsl_rng_type          *type_generateur_aleatoire;
 2010: 
 2011:     integer8                    nombre_arguments;
 2012: 
 2013:     /*
 2014:      * Il s'agit du nombre d'arguments utilisé pour l'évaluation
 2015:      * des expressions algébriques.
 2016:      * -1 : la fonction ne peut être dans un objet de type ALG.
 2017:      * -2 : nombre d'arguments inconnu
 2018:      *  0 : la fonction doit apparaître en notation infixe
 2019:      * >0 : la fonction apparaît comme une fonction normale
 2020:      */
 2021: 
 2022:     logical1                    lancement_interactif;
 2023: 
 2024:     unsigned char               *chemin_fichiers_temporaires;
 2025:     unsigned char               langue;
 2026:     unsigned char               retour_routine_evaluation;
 2027:     unsigned char               *localisation;
 2028: 
 2029:     unsigned long               niveau_recursivite;
 2030: 
 2031:     pid_t                       pid_processus_pere;
 2032:     pthread_t                   tid_processus_pere;
 2033: 
 2034:     logical1                    processus_detache;
 2035: 
 2036: /* Profilage                                            */
 2037: 
 2038:     logical1                    profilage;
 2039:     int                         niveau_profilage;
 2040:     struct_liste_profilage      *pile_profilage;
 2041:     struct_liste_profilage2     *pile_profilage_fonctions;
 2042:     struct timeval              horodatage_profilage;
 2043: 
 2044:     // Mutex spécifique au processus et donnant accès à la pile des processus
 2045:     pthread_mutex_t             mutex;
 2046:     pthread_mutex_t             mutex_allocation;
 2047: 
 2048:     // Sémaphore autorisant les fork()
 2049:     sem_t
 2050: #   ifdef SEMAPHORES_NOMMES
 2051:     *
 2052: #   endif
 2053:                                 semaphore_fork;
 2054: 
 2055: /* Mutexes                                          */
 2056: 
 2057:     struct_liste_chainee        *liste_mutexes;
 2058:     pthread_mutex_t             protection_liste_mutexes;
 2059: 
 2060: /* Gestion optimisée de la mémoire                  */
 2061: 
 2062:     double                      estimation_taille_pile_tampon;
 2063:     unsigned long               taille_pile_tampon;
 2064:     struct_liste_chainee        *pile_tampon;
 2065: 
 2066:     double                      estimation_taille_pile_systeme_tampon;
 2067:     unsigned long               taille_pile_systeme_tampon;
 2068:     struct_liste_pile_systeme   *pile_systeme_tampon;
 2069: 
 2070:     unsigned long               taille_pile_objets;
 2071:     struct_objet                *pile_objets;
 2072: 
 2073: #   ifndef DEBUG_MALLOC
 2074: #       define TAILLE_CACHE 16384
 2075: #   else
 2076: #       define TAILLE_CACHE 4
 2077: #   endif
 2078: 
 2079:     unsigned long               *objets_adr[TAILLE_CACHE];
 2080:     int                         pointeur_adr;
 2081: 
 2082:     logical8                    *objets_bin[TAILLE_CACHE];
 2083:     int                         pointeur_bin;
 2084: 
 2085:     complex16                   *objets_cpl[TAILLE_CACHE];
 2086:     int                         pointeur_cpl;
 2087: 
 2088:     struct fonction             *objets_fct[TAILLE_CACHE];
 2089:     int                         pointeur_fct;
 2090: 
 2091:     integer8                    *objets_int[TAILLE_CACHE];
 2092:     int                         pointeur_int;
 2093: 
 2094:     struct_matrice              *objets_mat[TAILLE_CACHE];
 2095:     int                         pointeur_mat;
 2096: 
 2097:     struct_nom                  *objets_nom[TAILLE_CACHE];
 2098:     int                         pointeur_nom;
 2099: 
 2100:     real8                       *objets_rel[TAILLE_CACHE];
 2101:     int                         pointeur_rel;
 2102: 
 2103:     struct_tableau              *objets_tab[TAILLE_CACHE];
 2104:     int                         pointeur_tab;
 2105: 
 2106:     struct_vecteur              *objets_vec[TAILLE_CACHE];
 2107:     int                         pointeur_vec;
 2108: 
 2109:     struct_liste_chainee        *maillons[TAILLE_CACHE];
 2110:     int                         pointeur_maillons;
 2111: } struct_processus;
 2112: #endif
 2113: 
 2114: /*
 2115: --------------------------------------------------------------------------------
 2116:   Structures instruction intrinsèque
 2117: --------------------------------------------------------------------------------
 2118: */
 2119: 
 2120: #ifndef RPLARGS
 2121: typedef struct instruction
 2122: {
 2123:     struct instruction      **noeud;
 2124:     void                    (*feuille)(struct_processus *);
 2125: } struct_instruction;
 2126: #endif
 2127: 
 2128: 
 2129: /*
 2130: --------------------------------------------------------------------------------
 2131:   Structure fonction
 2132: --------------------------------------------------------------------------------
 2133: */
 2134: 
 2135: #ifndef RPLARGS
 2136: typedef struct fonction
 2137: {
 2138:     unsigned char                       *nom_fonction;
 2139:     unsigned long                       nombre_arguments;
 2140: 
 2141:     void                                (*fonction)(struct_processus *);
 2142: 
 2143:     volatile struct_liste_chainee       *prediction_saut;
 2144:     volatile logical1                   prediction_execution;
 2145: } struct_fonction;
 2146: #endif
 2147: 
 2148: 
 2149: /*
 2150: ================================================================================
 2151:   PROTOTYPES
 2152: ================================================================================
 2153: */
 2154: 
 2155: /*
 2156: --------------------------------------------------------------------------------
 2157:   Procédures d'exécution des mots-clef du langage RPL/2
 2158: --------------------------------------------------------------------------------
 2159: */
 2160: 
 2161: // BEGIN C PROTOTYPES
 2162: void instruction_sensible_e(struct_processus *s_etat_processus);
 2163: void instruction_sensible_i(struct_processus *s_etat_processus);
 2164: 
 2165: void instruction_abort(struct_processus *s_etat_processus);
 2166: void instruction_abs(struct_processus *s_etat_processus);
 2167: void instruction_acos(struct_processus *s_etat_processus);
 2168: void instruction_acosh(struct_processus *s_etat_processus);
 2169: void instruction_alarm(struct_processus *s_etat_processus);
 2170: void instruction_alog(struct_processus *s_etat_processus);
 2171: void instruction_and(struct_processus *s_etat_processus);
 2172: void instruction_append(struct_processus *s_etat_processus);
 2173: void instruction_array_fleche(struct_processus *s_etat_processus);
 2174: void instruction_arg(struct_processus *s_etat_processus);
 2175: void instruction_asin(struct_processus *s_etat_processus);
 2176: void instruction_asinh(struct_processus *s_etat_processus);
 2177: void instruction_asl(struct_processus *s_etat_processus);
 2178: void instruction_asr(struct_processus *s_etat_processus);
 2179: void instruction_atan(struct_processus *s_etat_processus);
 2180: void instruction_atanh(struct_processus *s_etat_processus);
 2181: void instruction_atexit(struct_processus *s_etat_processus);
 2182: void instruction_atpoke(struct_processus *s_etat_processus);
 2183: void instruction_autoscale(struct_processus *s_etat_processus);
 2184: void instruction_axes(struct_processus *s_etat_processus);
 2185: 
 2186: void instruction_b_vers_r(struct_processus *s_etat_processus);
 2187: void instruction_backspace(struct_processus *s_etat_processus);
 2188: void instruction_backtrace(struct_processus *s_etat_processus);
 2189: void instruction_beep(struct_processus *s_etat_processus);
 2190: void instruction_bessel(struct_processus *s_etat_processus);
 2191: void instruction_bin(struct_processus *s_etat_processus);
 2192: 
 2193: void instruction_c_vers_r(struct_processus *s_etat_processus);
 2194: void instruction_case(struct_processus *s_etat_processus);
 2195: void instruction_ceil(struct_processus *s_etat_processus);
 2196: void instruction_centr(struct_processus *s_etat_processus);
 2197: void instruction_cf(struct_processus *s_etat_processus);
 2198: void instruction_chr(struct_processus *s_etat_processus);
 2199: void instruction_clear(struct_processus *s_etat_processus);
 2200: void instruction_cllcd(struct_processus *s_etat_processus);
 2201: void instruction_clmf(struct_processus *s_etat_processus);
 2202: void instruction_close(struct_processus *s_etat_processus);
 2203: void instruction_clratexit(struct_processus *s_etat_processus);
 2204: void instruction_clratpoke(struct_processus *s_etat_processus);
 2205: void instruction_clrcntxt(struct_processus *s_etat_processus);
 2206: void instruction_clrerr(struct_processus *s_etat_processus);
 2207: void instruction_clrfuse(struct_processus *s_etat_processus);
 2208: void instruction_clrmtx(struct_processus *s_etat_processus);
 2209: void instruction_clrsmphr(struct_processus *s_etat_processus);
 2210: void instruction_clrswi(struct_processus *s_etat_processus);
 2211: void instruction_cls(struct_processus *s_etat_processus);
 2212: void instruction_clusr(struct_processus *s_etat_processus);
 2213: void instruction_cnrm(struct_processus *s_etat_processus);
 2214: void instruction_cols(struct_processus *s_etat_processus);
 2215: void instruction_col_fleche(struct_processus *s_etat_processus);
 2216: void instruction_col_moins(struct_processus *s_etat_processus);
 2217: void instruction_col_plus(struct_processus *s_etat_processus);
 2218: void instruction_comb(struct_processus *s_etat_processus);
 2219: void instruction_con(struct_processus *s_etat_processus);
 2220: void instruction_cond(struct_processus *s_etat_processus);
 2221: void instruction_cont(struct_processus *s_etat_processus);
 2222: void instruction_continue(struct_processus *s_etat_processus);
 2223: void instruction_conj(struct_processus *s_etat_processus);
 2224: void instruction_convert(struct_processus *s_etat_processus);
 2225: void instruction_copy(struct_processus *s_etat_processus);
 2226: void instruction_copyright(struct_processus *s_etat_processus);
 2227: void instruction_corr(struct_processus *s_etat_processus);
 2228: void instruction_cos(struct_processus *s_etat_processus);
 2229: void instruction_cosh(struct_processus *s_etat_processus);
 2230: void instruction_cov(struct_processus *s_etat_processus);
 2231: void instruction_cr(struct_processus *s_etat_processus);
 2232: void instruction_create(struct_processus *s_etat_processus);
 2233: void instruction_crmtx(struct_processus *s_etat_processus);
 2234: void instruction_cross(struct_processus *s_etat_processus);
 2235: void instruction_crsmphr(struct_processus *s_etat_processus);
 2236: void instruction_crtab(struct_processus *s_etat_processus);
 2237: void instruction_cstop(struct_processus *s_etat_processus);
 2238: void instruction_cswp(struct_processus *s_etat_processus);
 2239: void instruction_currenc(struct_processus *s_etat_processus);
 2240: void instruction_cycle(struct_processus *s_etat_processus);
 2241: 
 2242: void instruction_d_vers_r(struct_processus *s_etat_processus);
 2243: void instruction_daemonize(struct_processus *s_etat_processus);
 2244: void instruction_date(struct_processus *s_etat_processus);
 2245: void instruction_dec(struct_processus *s_etat_processus);
 2246: void instruction_decr(struct_processus *s_etat_processus);
 2247: void instruction_default(struct_processus *s_etat_processus);
 2248: void instruction_deg(struct_processus *s_etat_processus);
 2249: void instruction_delete(struct_processus *s_etat_processus);
 2250: void instruction_depnd(struct_processus *s_etat_processus);
 2251: void instruction_depth(struct_processus *s_etat_processus);
 2252: void instruction_der(struct_processus *s_etat_processus);
 2253: void instruction_det(struct_processus *s_etat_processus);
 2254: void instruction_detach(struct_processus *s_etat_processus);
 2255: void instruction_dft(struct_processus *s_etat_processus);
 2256: void instruction_dgtiz(struct_processus *s_etat_processus);
 2257: void instruction_diag_fleche(struct_processus *s_etat_processus);
 2258: void instruction_disp(struct_processus *s_etat_processus);
 2259: void instruction_division(struct_processus *s_etat_processus);
 2260: void instruction_do(struct_processus *s_etat_processus);
 2261: void instruction_dot(struct_processus *s_etat_processus);
 2262: void instruction_draw(struct_processus *s_etat_processus);
 2263: void instruction_drax(struct_processus *s_etat_processus);
 2264: void instruction_drop(struct_processus *s_etat_processus);
 2265: void instruction_drop2(struct_processus *s_etat_processus);
 2266: void instruction_dropcntxt(struct_processus *s_etat_processus);
 2267: void instruction_dropn(struct_processus *s_etat_processus);
 2268: void instruction_drws(struct_processus *s_etat_processus);
 2269: void instruction_dup(struct_processus *s_etat_processus);
 2270: void instruction_dup2(struct_processus *s_etat_processus);
 2271: void instruction_dupcntxt(struct_processus *s_etat_processus);
 2272: void instruction_dupn(struct_processus *s_etat_processus);
 2273: 
 2274: void instruction_e(struct_processus *s_etat_processus);
 2275: void instruction_edit(struct_processus *s_etat_processus);
 2276: void instruction_egalite(struct_processus *s_etat_processus);
 2277: void instruction_egv(struct_processus *s_etat_processus);
 2278: void instruction_egvl(struct_processus *s_etat_processus);
 2279: void instruction_else(struct_processus *s_etat_processus);
 2280: void instruction_elseif(struct_processus *s_etat_processus);
 2281: void instruction_end(struct_processus *s_etat_processus);
 2282: void instruction_eng(struct_processus *s_etat_processus);
 2283: void instruction_epsilon(struct_processus *s_etat_processus);
 2284: void instruction_erase(struct_processus *s_etat_processus);
 2285: void instruction_errm(struct_processus *s_etat_processus);
 2286: void instruction_errn(struct_processus *s_etat_processus);
 2287: void instruction_eval(struct_processus *s_etat_processus);
 2288: void instruction_exget(struct_processus *s_etat_processus);
 2289: void instruction_exit(struct_processus *s_etat_processus);
 2290: void instruction_exp(struct_processus *s_etat_processus);
 2291: void instruction_expm(struct_processus *s_etat_processus);
 2292: void instruction_exsub(struct_processus *s_etat_processus);
 2293: void instruction_externals(struct_processus *s_etat_processus);
 2294: void instruction_eyept(struct_processus *s_etat_processus);
 2295: 
 2296: void instruction_fact(struct_processus *s_etat_processus);
 2297: void instruction_false(struct_processus *s_etat_processus);
 2298: void instruction_fc_test(struct_processus *s_etat_processus);
 2299: void instruction_fc_test_c(struct_processus *s_etat_processus);
 2300: void instruction_fc_test_s(struct_processus *s_etat_processus);
 2301: void instruction_fft(struct_processus *s_etat_processus);
 2302: void instruction_fix(struct_processus *s_etat_processus);
 2303: void instruction_fleche(struct_processus *s_etat_processus);
 2304: void instruction_fleche_array(struct_processus *s_etat_processus);
 2305: void instruction_fleche_col(struct_processus *s_etat_processus);
 2306: void instruction_fleche_diag(struct_processus *s_etat_processus);
 2307: void instruction_fleche_hms(struct_processus *s_etat_processus);
 2308: void instruction_fleche_lcd(struct_processus *s_etat_processus);
 2309: void instruction_fleche_list(struct_processus *s_etat_processus);
 2310: void instruction_fleche_num(struct_processus *s_etat_processus);
 2311: void instruction_fleche_q(struct_processus *s_etat_processus);
 2312: void instruction_fleche_row(struct_processus *s_etat_processus);
 2313: void instruction_fleche_str(struct_processus *s_etat_processus);
 2314: void instruction_fleche_table(struct_processus *s_etat_processus);
 2315: void instruction_floor(struct_processus *s_etat_processus);
 2316: void instruction_for(struct_processus *s_etat_processus);
 2317: void instruction_format(struct_processus *s_etat_processus);
 2318: void instruction_fp(struct_processus *s_etat_processus);
 2319: void instruction_fs_test(struct_processus *s_etat_processus);
 2320: void instruction_fs_test_c(struct_processus *s_etat_processus);
 2321: void instruction_fs_test_s(struct_processus *s_etat_processus);
 2322: void instruction_function(struct_processus *s_etat_processus);
 2323: void instruction_fuse(struct_processus *s_etat_processus);
 2324: 
 2325: void instruction_gamma(struct_processus *s_etat_processus);
 2326: void instruction_ge(struct_processus *s_etat_processus);
 2327: void instruction_gegv(struct_processus *s_etat_processus);
 2328: void instruction_gegvl(struct_processus *s_etat_processus);
 2329: void instruction_get(struct_processus *s_etat_processus);
 2330: void instruction_getc(struct_processus *s_etat_processus);
 2331: void instruction_geti(struct_processus *s_etat_processus);
 2332: void instruction_getr(struct_processus *s_etat_processus);
 2333: void instruction_glegv(struct_processus *s_etat_processus);
 2334: void instruction_gregv(struct_processus *s_etat_processus);
 2335: void instruction_gt(struct_processus *s_etat_processus);
 2336: 
 2337: void instruction_halt(struct_processus *s_etat_processus);
 2338: void instruction_head(struct_processus *s_etat_processus);
 2339: void instruction_help(struct_processus *s_etat_processus);
 2340: void instruction_hex(struct_processus *s_etat_processus);
 2341: void instruction_histogram(struct_processus *s_etat_processus);
 2342: void instruction_hms_fleche(struct_processus *s_etat_processus);
 2343: void instruction_hms_moins(struct_processus *s_etat_processus);
 2344: void instruction_hms_plus(struct_processus *s_etat_processus);
 2345: 
 2346: void instruction_i(struct_processus *s_etat_processus);
 2347: void instruction_idft(struct_processus *s_etat_processus);
 2348: void instruction_idn(struct_processus *s_etat_processus);
 2349: void instruction_if(struct_processus *s_etat_processus);
 2350: void instruction_iferr(struct_processus *s_etat_processus);
 2351: void instruction_ifft(struct_processus *s_etat_processus);
 2352: void instruction_ift(struct_processus *s_etat_processus);
 2353: void instruction_ifte(struct_processus *s_etat_processus);
 2354: void instruction_im(struct_processus *s_etat_processus);
 2355: void instruction_implicit(struct_processus *s_etat_processus);
 2356: void instruction_in(struct_processus *s_etat_processus);
 2357: void instruction_incr(struct_processus *s_etat_processus);
 2358: void instruction_indep(struct_processus *s_etat_processus);
 2359: void instruction_input(struct_processus *s_etat_processus);
 2360: void instruction_inquire(struct_processus *s_etat_processus);
 2361: void instruction_int(struct_processus *s_etat_processus);
 2362: void instruction_interrupt(struct_processus *s_etat_processus);
 2363: void instruction_inv(struct_processus *s_etat_processus);
 2364: void instruction_ip(struct_processus *s_etat_processus);
 2365: void instruction_iswi(struct_processus *s_etat_processus);
 2366: void instruction_itrace(struct_processus *s_etat_processus);
 2367: 
 2368: void instruction_jdate(struct_processus *s_etat_processus);
 2369: 
 2370: void instruction_key(struct_processus *s_etat_processus);
 2371: void instruction_keylabel(struct_processus *s_etat_processus);
 2372: void instruction_keytitle(struct_processus *s_etat_processus);
 2373: void instruction_kill(struct_processus *s_etat_processus);
 2374: void instruction_kind(struct_processus *s_etat_processus);
 2375: 
 2376: void instruction_label(struct_processus *s_etat_processus);
 2377: void instruction_last(struct_processus *s_etat_processus);
 2378: void instruction_lcase(struct_processus *s_etat_processus);
 2379: void instruction_lcd_fleche(struct_processus *s_etat_processus);
 2380: void instruction_lchol(struct_processus *s_etat_processus);
 2381: void instruction_le(struct_processus *s_etat_processus);
 2382: void instruction_legv(struct_processus *s_etat_processus);
 2383: void instruction_line(struct_processus *s_etat_processus);
 2384: void instruction_list_fleche(struct_processus *s_etat_processus);
 2385: void instruction_ln(struct_processus *s_etat_processus);
 2386: void instruction_lnp1(struct_processus *s_etat_processus);
 2387: void instruction_localization(struct_processus *s_etat_processus);
 2388: void instruction_lock(struct_processus *s_etat_processus);
 2389: void instruction_log(struct_processus *s_etat_processus);
 2390: void instruction_logger(struct_processus *s_etat_processus);
 2391: void instruction_logscale(struct_processus *s_etat_processus);
 2392: void instruction_lq(struct_processus *s_etat_processus);
 2393: void instruction_lsq(struct_processus *s_etat_processus);
 2394: void instruction_lt(struct_processus *s_etat_processus);
 2395: void instruction_lu(struct_processus *s_etat_processus);
 2396: 
 2397: void instruction_mant(struct_processus *s_etat_processus);
 2398: void instruction_mark(struct_processus *s_etat_processus);
 2399: void instruction_max(struct_processus *s_etat_processus);
 2400: void instruction_maxs(struct_processus *s_etat_processus);
 2401: void instruction_mclrin(struct_processus *s_etat_processus);
 2402: void instruction_mean(struct_processus *s_etat_processus);
 2403: void instruction_mem(struct_processus *s_etat_processus);
 2404: void instruction_memlock(struct_processus *s_etat_processus);
 2405: void instruction_memunlock(struct_processus *s_etat_processus);
 2406: void instruction_min(struct_processus *s_etat_processus);
 2407: void instruction_mins(struct_processus *s_etat_processus);
 2408: void instruction_mod(struct_processus *s_etat_processus);
 2409: void instruction_moins(struct_processus *s_etat_processus);
 2410: void instruction_mtxlock(struct_processus *s_etat_processus);
 2411: void instruction_mtxstatus(struct_processus *s_etat_processus);
 2412: void instruction_mtxtrylock(struct_processus *s_etat_processus);
 2413: void instruction_mtxunlock(struct_processus *s_etat_processus);
 2414: void instruction_multiplication(struct_processus *s_etat_processus);
 2415: 
 2416: void instruction_ne(struct_processus *s_etat_processus);
 2417: void instruction_neg(struct_processus *s_etat_processus);
 2418: void instruction_next(struct_processus *s_etat_processus);
 2419: void instruction_newplane(struct_processus *s_etat_processus);
 2420: void instruction_not(struct_processus *s_etat_processus);
 2421: void instruction_nrand(struct_processus *s_etat_processus);
 2422: void instruction_nrproc(struct_processus *s_etat_processus);
 2423: void instruction_ns(struct_processus *s_etat_processus);
 2424: void instruction_num(struct_processus *s_etat_processus);
 2425: 
 2426: void instruction_obget(struct_processus *s_etat_processus);
 2427: void instruction_obsub(struct_processus *s_etat_processus);
 2428: void instruction_oct(struct_processus *s_etat_processus);
 2429: void instruction_open(struct_processus *s_etat_processus);
 2430: void instruction_or(struct_processus *s_etat_processus);
 2431: void instruction_over(struct_processus *s_etat_processus);
 2432: 
 2433: void instruction_p_vers_r(struct_processus *s_etat_processus);
 2434: void instruction_paper(struct_processus *s_etat_processus);
 2435: void instruction_parameter(struct_processus *s_etat_processus);
 2436: void instruction_parametric(struct_processus *s_etat_processus);
 2437: void instruction_pcov(struct_processus *s_etat_processus);
 2438: void instruction_peek(struct_processus *s_etat_processus);
 2439: void instruction_perm(struct_processus *s_etat_processus);
 2440: void instruction_persist(struct_processus *s_etat_processus);
 2441: void instruction_pi(struct_processus *s_etat_processus);
 2442: void instruction_pick(struct_processus *s_etat_processus);
 2443: void instruction_plot(struct_processus *s_etat_processus);
 2444: void instruction_plotter(struct_processus *s_etat_processus);
 2445: void instruction_plus(struct_processus *s_etat_processus);
 2446: void instruction_pmax(struct_processus *s_etat_processus);
 2447: void instruction_pmin(struct_processus *s_etat_processus);
 2448: void instruction_poke(struct_processus *s_etat_processus);
 2449: void instruction_polar(struct_processus *s_etat_processus);
 2450: void instruction_pos(struct_processus *s_etat_processus);
 2451: void instruction_pourcent(struct_processus *s_etat_processus);
 2452: void instruction_pourcent_ch(struct_processus *s_etat_processus);
 2453: void instruction_pourcent_t(struct_processus *s_etat_processus);
 2454: void instruction_ppar(struct_processus *s_etat_processus);
 2455: void instruction_pr1(struct_processus *s_etat_processus);
 2456: void instruction_print(struct_processus *s_etat_processus);
 2457: void instruction_private(struct_processus *s_etat_processus);
 2458: void instruction_prlcd(struct_processus *s_etat_processus);
 2459: void instruction_prmd(struct_processus *s_etat_processus);
 2460: void instruction_procid(struct_processus *s_etat_processus);
 2461: void instruction_prompt(struct_processus *s_etat_processus);
 2462: void instruction_protect(struct_processus *s_etat_processus);
 2463: void instruction_prst(struct_processus *s_etat_processus);
 2464: void instruction_prstc(struct_processus *s_etat_processus);
 2465: void instruction_prusr(struct_processus *s_etat_processus);
 2466: void instruction_prvar(struct_processus *s_etat_processus);
 2467: void instruction_psdev(struct_processus *s_etat_processus);
 2468: void instruction_puissance(struct_processus *s_etat_processus);
 2469: void instruction_purge(struct_processus *s_etat_processus);
 2470: void instruction_pshcntxt(struct_processus *s_etat_processus);
 2471: void instruction_pshprfl(struct_processus *s_etat_processus);
 2472: void instruction_pulcntxt(struct_processus *s_etat_processus);
 2473: void instruction_pulprfl(struct_processus *s_etat_processus);
 2474: void instruction_put(struct_processus *s_etat_processus);
 2475: void instruction_putc(struct_processus *s_etat_processus);
 2476: void instruction_puti(struct_processus *s_etat_processus);
 2477: void instruction_putr(struct_processus *s_etat_processus);
 2478: void instruction_pvar(struct_processus *s_etat_processus);
 2479: 
 2480: void instruction_qr(struct_processus *s_etat_processus);
 2481: 
 2482: void instruction_r_vers_b(struct_processus *s_etat_processus);
 2483: void instruction_r_vers_c(struct_processus *s_etat_processus);
 2484: void instruction_r_vers_d(struct_processus *s_etat_processus);
 2485: void instruction_r_vers_p(struct_processus *s_etat_processus);
 2486: void instruction_rad(struct_processus *s_etat_processus);
 2487: void instruction_rand(struct_processus *s_etat_processus);
 2488: void instruction_rank(struct_processus *s_etat_processus);
 2489: void instruction_rceq(struct_processus *s_etat_processus);
 2490: void instruction_rci(struct_processus *s_etat_processus);
 2491: void instruction_rcij(struct_processus *s_etat_processus);
 2492: void instruction_rcl(struct_processus *s_etat_processus);
 2493: void instruction_rclf(struct_processus *s_etat_processus);
 2494: void instruction_rcls(struct_processus *s_etat_processus);
 2495: void instruction_rclswi(struct_processus *s_etat_processus);
 2496: void instruction_rcws(struct_processus *s_etat_processus);
 2497: void instruction_rdate(struct_processus *s_etat_processus);
 2498: void instruction_rdm(struct_processus *s_etat_processus);
 2499: void instruction_rdgn(struct_processus *s_etat_processus);
 2500: void instruction_rdz(struct_processus *s_etat_processus);
 2501: void instruction_re(struct_processus *s_etat_processus);
 2502: void instruction_read(struct_processus *s_etat_processus);
 2503: void instruction_recode(struct_processus *s_etat_processus);
 2504: void instruction_recv(struct_processus *s_etat_processus);
 2505: void instruction_redraw(struct_processus *s_etat_processus);
 2506: void instruction_relax(struct_processus *s_etat_processus);
 2507: void instruction_remove(struct_processus *s_etat_processus);
 2508: void instruction_res(struct_processus *s_etat_processus);
 2509: void instruction_recall(struct_processus *s_etat_processus);
 2510: void instruction_regv(struct_processus *s_etat_processus);
 2511: void instruction_repeat(struct_processus *s_etat_processus);
 2512: void instruction_repl(struct_processus *s_etat_processus);
 2513: void instruction_return(struct_processus *s_etat_processus);
 2514: void instruction_revlist(struct_processus *s_etat_processus);
 2515: void instruction_rewind(struct_processus *s_etat_processus);
 2516: void instruction_rfuse(struct_processus *s_etat_processus);
 2517: void instruction_rl(struct_processus *s_etat_processus);
 2518: void instruction_rlb(struct_processus *s_etat_processus);
 2519: void instruction_rnd(struct_processus *s_etat_processus);
 2520: void instruction_rnrm(struct_processus *s_etat_processus);
 2521: void instruction_roll(struct_processus *s_etat_processus);
 2522: void instruction_rolld(struct_processus *s_etat_processus);
 2523: void instruction_rot(struct_processus *s_etat_processus);
 2524: void instruction_row_fleche(struct_processus *s_etat_processus);
 2525: void instruction_row_moins(struct_processus *s_etat_processus);
 2526: void instruction_row_plus(struct_processus *s_etat_processus);
 2527: void instruction_rr(struct_processus *s_etat_processus);
 2528: void instruction_rrb(struct_processus *s_etat_processus);
 2529: void instruction_rsd(struct_processus *s_etat_processus);
 2530: void instruction_rstop(struct_processus *s_etat_processus);
 2531: void instruction_rswp(struct_processus *s_etat_processus);
 2532: 
 2533: void instruction_s_moins(struct_processus *s_etat_processus);
 2534: void instruction_s_plus(struct_processus *s_etat_processus);
 2535: void instruction_same(struct_processus *s_etat_processus);
 2536: void instruction_save(struct_processus *s_etat_processus);
 2537: void instruction_scatter(struct_processus *s_etat_processus);
 2538: void instruction_scale(struct_processus *s_etat_processus);
 2539: void instruction_sched(struct_processus *s_etat_processus);
 2540: void instruction_schur(struct_processus *s_etat_processus);
 2541: void instruction_sci(struct_processus *s_etat_processus);
 2542: void instruction_scls(struct_processus *s_etat_processus);
 2543: void instruction_sconj(struct_processus *s_etat_processus);
 2544: void instruction_sdev(struct_processus *s_etat_processus);
 2545: void instruction_select(struct_processus *s_etat_processus);
 2546: void instruction_send(struct_processus *s_etat_processus);
 2547: void instruction_sf(struct_processus *s_etat_processus);
 2548: void instruction_shared(struct_processus *s_etat_processus);
 2549: void instruction_sign(struct_processus *s_etat_processus);
 2550: void instruction_sin(struct_processus *s_etat_processus);
 2551: void instruction_sinh(struct_processus *s_etat_processus);
 2552: void instruction_sinv(struct_processus *s_etat_processus);
 2553: void instruction_size(struct_processus *s_etat_processus);
 2554: void instruction_sl(struct_processus *s_etat_processus);
 2555: void instruction_slb(struct_processus *s_etat_processus);
 2556: void instruction_slice(struct_processus *s_etat_processus);
 2557: void instruction_slicescale(struct_processus *s_etat_processus);
 2558: void instruction_smphrdecr(struct_processus *s_etat_processus);
 2559: void instruction_smphrgetv(struct_processus *s_etat_processus);
 2560: void instruction_smphrincr(struct_processus *s_etat_processus);
 2561: void instruction_smphrtrydecr(struct_processus *s_etat_processus);
 2562: void instruction_sneg(struct_processus *s_etat_processus);
 2563: void instruction_sort(struct_processus *s_etat_processus);
 2564: void instruction_spar(struct_processus *s_etat_processus);
 2565: void instruction_spawn(struct_processus *s_etat_processus);
 2566: void instruction_splash(struct_processus *s_etat_processus);
 2567: void instruction_sq(struct_processus *s_etat_processus);
 2568: void instruction_sqlconnect(struct_processus *s_etat_processus);
 2569: void instruction_sqldisconnect(struct_processus *s_etat_processus);
 2570: void instruction_sqlquery(struct_processus *s_etat_processus);
 2571: void instruction_sqrt(struct_processus *s_etat_processus);
 2572: void instruction_sr(struct_processus *s_etat_processus);
 2573: void instruction_srb(struct_processus *s_etat_processus);
 2574: void instruction_sst(struct_processus *s_etat_processus);
 2575: void instruction_star_d(struct_processus *s_etat_processus);
 2576: void instruction_star_h(struct_processus *s_etat_processus);
 2577: void instruction_star_s(struct_processus *s_etat_processus);
 2578: void instruction_star_w(struct_processus *s_etat_processus);
 2579: void instruction_start(struct_processus *s_etat_processus);
 2580: void instruction_static(struct_processus *s_etat_processus);
 2581: void instruction_std(struct_processus *s_etat_processus);
 2582: void instruction_step(struct_processus *s_etat_processus);
 2583: void instruction_steq(struct_processus *s_etat_processus);
 2584: void instruction_sto(struct_processus *s_etat_processus);
 2585: void instruction_sto_division(struct_processus *s_etat_processus);
 2586: void instruction_sto_fois(struct_processus *s_etat_processus);
 2587: void instruction_sto_moins(struct_processus *s_etat_processus);
 2588: void instruction_sto_plus(struct_processus *s_etat_processus);
 2589: void instruction_stof(struct_processus *s_etat_processus);
 2590: void instruction_stop(struct_processus *s_etat_processus);
 2591: void instruction_store(struct_processus *s_etat_processus);
 2592: void instruction_stos(struct_processus *s_etat_processus);
 2593: void instruction_stoswi(struct_processus *s_etat_processus);
 2594: void instruction_str_fleche(struct_processus *s_etat_processus);
 2595: void instruction_stws(struct_processus *s_etat_processus);
 2596: void instruction_sub(struct_processus *s_etat_processus);
 2597: void instruction_suspend(struct_processus *s_etat_processus);
 2598: void instruction_svd(struct_processus *s_etat_processus);
 2599: void instruction_svl(struct_processus *s_etat_processus);
 2600: void instruction_swap(struct_processus *s_etat_processus);
 2601: void instruction_swi(struct_processus *s_etat_processus);
 2602: void instruction_swilock(struct_processus *s_etat_processus);
 2603: void instruction_swiqueue(struct_processus *s_etat_processus);
 2604: void instruction_swistatus(struct_processus *s_etat_processus);
 2605: void instruction_swiunlock(struct_processus *s_etat_processus);
 2606: void instruction_swapcntxt(struct_processus *s_etat_processus);
 2607: void instruction_sx(struct_processus *s_etat_processus);
 2608: void instruction_sx2(struct_processus *s_etat_processus);
 2609: void instruction_sxy(struct_processus *s_etat_processus);
 2610: void instruction_sy(struct_processus *s_etat_processus);
 2611: void instruction_sy2(struct_processus *s_etat_processus);
 2612: void instruction_sync(struct_processus *s_etat_processus);
 2613: void instruction_syseval(struct_processus *s_etat_processus);
 2614: 
 2615: void instruction_table_fleche(struct_processus *s_etat_processus);
 2616: void instruction_tail(struct_processus *s_etat_processus);
 2617: void instruction_tan(struct_processus *s_etat_processus);
 2618: void instruction_tanh(struct_processus *s_etat_processus);
 2619: void instruction_target(struct_processus *s_etat_processus);
 2620: void instruction_taylr(struct_processus *s_etat_processus);
 2621: void instruction_then(struct_processus *s_etat_processus);
 2622: void instruction_time(struct_processus *s_etat_processus);
 2623: void instruction_title(struct_processus *s_etat_processus);
 2624: void instruction_tokenize(struct_processus *s_etat_processus);
 2625: void instruction_tot(struct_processus *s_etat_processus);
 2626: void instruction_trim(struct_processus *s_etat_processus);
 2627: void instruction_trn(struct_processus *s_etat_processus);
 2628: void instruction_trnc(struct_processus *s_etat_processus);
 2629: void instruction_true(struct_processus *s_etat_processus);
 2630: void instruction_type(struct_processus *s_etat_processus);
 2631: 
 2632: void instruction_ucase(struct_processus *s_etat_processus);
 2633: void instruction_uchol(struct_processus *s_etat_processus);
 2634: void instruction_undo(struct_processus *s_etat_processus);
 2635: void instruction_unlock(struct_processus *s_etat_processus);
 2636: void instruction_unprotect(struct_processus *s_etat_processus);
 2637: void instruction_until(struct_processus *s_etat_processus);
 2638: void instruction_use(struct_processus *s_etat_processus);
 2639: void instruction_utpc(struct_processus *s_etat_processus);
 2640: void instruction_utpf(struct_processus *s_etat_processus);
 2641: void instruction_utpn(struct_processus *s_etat_processus);
 2642: void instruction_utpt(struct_processus *s_etat_processus);
 2643: 
 2644: void instruction_var(struct_processus *s_etat_processus);
 2645: void instruction_variable(struct_processus *s_etat_processus);
 2646: void instruction_vars(struct_processus *s_etat_processus);
 2647: void instruction_verify(struct_processus *s_etat_processus);
 2648: void instruction_vers_niveau_inferieur(struct_processus *s_etat_processus);
 2649: void instruction_vers_niveau_superieur(struct_processus *s_etat_processus);
 2650: void instruction_version(struct_processus *s_etat_processus);
 2651: void instruction_visit(struct_processus *s_etat_processus);
 2652: void instruction_volatile(struct_processus *s_etat_processus);
 2653: 
 2654: void instruction_wait(struct_processus *s_etat_processus);
 2655: void instruction_warranty(struct_processus *s_etat_processus);
 2656: void instruction_wfdata(struct_processus *s_etat_processus);
 2657: void instruction_wfack(struct_processus *s_etat_processus);
 2658: void instruction_wflock(struct_processus *s_etat_processus);
 2659: void instruction_wfpoke(struct_processus *s_etat_processus);
 2660: void instruction_wfproc(struct_processus *s_etat_processus);
 2661: void instruction_wfsock(struct_processus *s_etat_processus);
 2662: void instruction_wfswi(struct_processus *s_etat_processus);
 2663: void instruction_while(struct_processus *s_etat_processus);
 2664: void instruction_wireframe(struct_processus *s_etat_processus);
 2665: void instruction_workdir(struct_processus *s_etat_processus);
 2666: void instruction_write(struct_processus *s_etat_processus);
 2667: 
 2668: void instruction_xcol(struct_processus *s_etat_processus);
 2669: void instruction_xor(struct_processus *s_etat_processus);
 2670: void instruction_xpon(struct_processus *s_etat_processus);
 2671: void instruction_xroot(struct_processus *s_etat_processus);
 2672: 
 2673: void instruction_ycol(struct_processus *s_etat_processus);
 2674: void instruction_yield(struct_processus *s_etat_processus);
 2675: 
 2676: /*
 2677: --------------------------------------------------------------------------------
 2678:   Procédures
 2679: --------------------------------------------------------------------------------
 2680: */
 2681: 
 2682: #ifndef RPLARGS
 2683: void affectation_interruptions_logicielles(struct_processus *s_etat_processus);
 2684: void affichage_pile(struct_processus *s_etat_processus,
 2685:         struct_liste_chainee *l_element_courant, unsigned long
 2686:         niveau_courant);
 2687: #endif
 2688: 
 2689: void *allocation(struct_processus *s_etat_processus, enum t_type type);
 2690: void *allocation_maillon(struct_processus *s_etat_processus);
 2691: 
 2692: #ifndef RPLARGS
 2693: void analyse(struct_processus *s_etat_processus, void (*fonction)());
 2694: void *analyse_instruction(struct_processus *s_etat_processus,
 2695:         unsigned char *candidat);
 2696: void appel_gnuplot(struct_processus *s_etat_processus,
 2697:         unsigned char persistance);
 2698: void cf(struct_processus *s_etat_processus, unsigned char indice_drapeau);
 2699: void cond(struct_processus *s_etat_processus,
 2700:         struct_matrice *s_matrice, real8 *condition);
 2701: void conversion_decimal_vers_hms(real8 *angle);
 2702: void conversion_degres_vers_radians(real8 *angle);
 2703: void conversion_element_tex(unsigned char **element, unsigned char *fonction);
 2704: void conversion_format(struct_processus *s_etat_processus,
 2705:         unsigned char *chaine);
 2706: void conversion_hms_vers_decimal(real8 *angle);
 2707: void conversion_majuscule_limitee(unsigned char *chaine_entree, 
 2708:         unsigned char *chaine_sortie, unsigned long longueur);
 2709: void conversion_radians_vers_degres(real8 *angle);
 2710: void correction_formateur_tex(struct_processus *s_etat_processus,
 2711:         unsigned char **ligne);
 2712: void depilement_pile_systeme(struct_processus *s_etat_processus);
 2713: void derivation(struct_processus *s_etat_processus,
 2714:         struct_objet **s_expression);
 2715: void determinant(struct_processus *s_etat_processus, struct_matrice *s_matrice,
 2716:         void *valeur);
 2717: void deverrouillage_threads_concurrents(struct_processus *s_etat_processus);
 2718: void ecriture_pile(struct_processus *s_etat_processus, file *flux,
 2719:         struct_liste_chainee *l_element_courant, unsigned long niveau_courant);
 2720: void ecriture_profil(struct_processus *s_etat_processus);
 2721: void effacement_pile_systeme(struct_processus *s_etat_processus);
 2722: void empilement_pile_systeme(struct_processus *s_etat_processus);
 2723: void encart(struct_processus *s_etat_processus, unsigned long duree);
 2724: void evaluation_romberg(struct_processus *s_etat_processus,
 2725:         struct_objet *s_expression, unsigned char *variable, real8 *point,
 2726:         real8 *valeur, logical1 *validite);
 2727: void factorisation_cholesky(struct_processus *s_etat_processus,
 2728:         struct_matrice *s_matrice, unsigned char mode);
 2729: void factorisation_lq(struct_processus *s_etat_processus,
 2730:         struct_matrice *s_matrice, void **tau);
 2731: void factorisation_lu(struct_processus *s_etat_processus,
 2732:         struct_matrice *s_matrice, struct_matrice **s_permutation);
 2733: void factorisation_qr(struct_processus *s_etat_processus,
 2734:         struct_matrice *s_matrice, void **tau);
 2735: void factorisation_schur(struct_processus *s_etat_processus,
 2736:         struct_matrice *s_matrice, struct_matrice **s_schur);
 2737: void *fusible(void *argument);
 2738: void formateur_tex(struct_processus *s_etat_processus, struct_objet *s_objet,
 2739:         unsigned char environnement);
 2740: void formateur_elementaire_tex(struct_processus *s_etat_processus,
 2741:         file *fichier, struct_objet *s_objet, unsigned char environnement);
 2742: void impression_pile(struct_processus *s_etat_processus,
 2743:             struct_liste_chainee *l_element_courant,
 2744:             unsigned char methode, unsigned long niveau_courant);
 2745: void impression_tex(struct_processus *s_etat_processus);
 2746: void informations(struct_processus *s_etat_processus);
 2747: void initialisation_allocateur(struct_processus *s_etat_processus);
 2748: void initialisation_completion(void);
 2749: void initialisation_drapeaux(struct_processus *s_etat_processus);
 2750: void initialisation_generateur_aleatoire(struct_processus *s_etat_processus,
 2751:         logical1 initialisation_automatique, unsigned long int racine);
 2752: void initialisation_instructions(struct_processus *s_etat_processus);
 2753: #endif
 2754: 
 2755: void initialisation_objet(struct_objet *s_objet);
 2756: 
 2757: #ifndef RPLARGS
 2758: void insertion_thread(struct_processus *s_etat_processus,
 2759:         logical1 thread_principal);
 2760: void insertion_thread_surveillance(struct_processus *s_etat_processus,
 2761:         struct_descripteur_thread *s_argument_thread);
 2762: void integrale_romberg(struct_processus *s_etat_processus,
 2763:         struct_objet *s_expression, unsigned char *variable,
 2764:         real8 a, real8 b, real8 precision);
 2765: void interruption1(SIGHANDLER_ARGS);
 2766: void interruption2(SIGHANDLER_ARGS);
 2767: void interruption3(SIGHANDLER_ARGS);
 2768: void interruption4(SIGHANDLER_ARGS);
 2769: void interruption5(SIGHANDLER_ARGS);
 2770: void interruption6(SIGHANDLER_ARGS);
 2771: void interruption7(SIGHANDLER_ARGS);
 2772: void interruption8(SIGHANDLER_ARGS);
 2773: void interruption9(SIGHANDLER_ARGS);
 2774: void interruption10(SIGHANDLER_ARGS);
 2775: void interruption11(SIGHANDLER_ARGS);
 2776: void inversion_matrice(struct_processus *s_etat_processus,
 2777:         struct_matrice *s_matrice);
 2778: void lancement_daemon(struct_processus *s_etat_processus);
 2779: void *lancement_thread(void *argument);
 2780: #endif
 2781: 
 2782: void liberation(struct_processus *s_etat_processus, struct_objet *s_objet);
 2783: void liberation_maillon(struct_processus *s_etat_processus,
 2784:         struct_liste_chainee *maillon);
 2785: 
 2786: #ifndef RPLARGS
 2787: void liberation_allocateur(struct_processus *s_etat_processus);
 2788: void liberation_arbre_instructions(struct_processus *s_etat_processus,
 2789:         struct_instruction *arbre);
 2790: void liberation_generateur_aleatoire(struct_processus *s_etat_processus);
 2791: void liberation_threads(struct_processus *s_etat_processus);
 2792: void liberation_profil(struct_processus *s_etat_processus);
 2793: void localisation_courante(struct_processus *s_etat_processus);
 2794: void modification_pid_thread_pere(struct_processus *s_etat_processus);
 2795: void moindres_carres(struct_processus *s_etat_processus,
 2796:         struct_matrice *s_matrice_a, struct_matrice *s_matrice_b,
 2797:         struct_matrice *s_matrice_x);
 2798: void profilage(struct_processus *s_etat_processus, unsigned char *fonction);
 2799: void rang(struct_processus *s_etat_processus, struct_matrice *s_matrice,
 2800:         integer8 *valeur);
 2801: void recherche_type(struct_processus *s_etat_processus);
 2802: void retrait_thread(struct_processus *s_etat_processus);
 2803: void retrait_thread_surveillance(struct_processus *s_etat_processus,
 2804:         struct_descripteur_thread *s_argument_thread);
 2805: void rplcore(struct_processus *s_etat_processus);
 2806: void scrutation_injection(struct_processus *s_etat_processus);
 2807: void sf(struct_processus *s_etat_processus, unsigned char indice_drapeau);
 2808: void *surveillance_processus(void *argument);
 2809: void swap(void *variable_1, void *variable_2, unsigned long taille_octets);
 2810: void trace(struct_processus *s_etat_processus, FILE *flux);
 2811: void traitement_asynchrone_exceptions_gsl(struct_processus *s_etat_processus);
 2812: void traitement_exceptions_gsl(const char *reason, const char *file,
 2813:         int line, int gsl_errno);
 2814: void traitement_interruptions_logicielles(struct_processus *s_etat_processus);
 2815: void tri_base_symboles_externes(struct_processus *s_etat_processus);
 2816: void tri_vecteur(real8 *vecteur, unsigned long taille);
 2817: void valeurs_propres(struct_processus *s_etat_processus,
 2818:         struct_matrice *s_matrice,
 2819:         struct_vecteur *s_valeurs_propres,
 2820:         struct_matrice *s_vecteurs_propres_gauches,
 2821:         struct_matrice *s_vecteur_propres_droits);
 2822: void valeurs_propres_generalisees(struct_processus *s_etat_processus,
 2823:         struct_matrice *s_matrice,
 2824:         struct_matrice *s_metrique,
 2825:         struct_vecteur *s_valeurs_propres,
 2826:         struct_matrice *s_vecteurs_propres_gauches,
 2827:         struct_matrice *s_vecteur_propres_droits);
 2828: void valeurs_singulieres(struct_processus *s_etat_processus,
 2829:         struct_matrice *s_matrice,
 2830:         struct_matrice *u, struct_vecteur *s, struct_matrice *vh);
 2831: void verrouillage_threads_concurrents(struct_processus *s_etat_processus);
 2832: #endif
 2833: 
 2834: #ifndef RPLARGS
 2835: #ifdef _BROKEN_SIGINFO
 2836: void creation_fifos_signaux(struct_processus *s_etat_processus);
 2837: void destruction_fifos_signaux(struct_processus *s_etat_processus);
 2838: void liberation_fifos_signaux(struct_processus *s_etat_processus);
 2839: #endif
 2840: #endif
 2841: 
 2842: /*
 2843: --------------------------------------------------------------------------------
 2844:   Fonctions de sommation de vecteur dans perte de précision
 2845: --------------------------------------------------------------------------------
 2846: */
 2847: 
 2848: real8 sommation_vecteur_reel(real8 *vecteur, unsigned long *taille,
 2849:         logical1 *erreur_memoire);
 2850: complex16 sommation_vecteur_complexe(complex16 *vecteur, unsigned long *taille,
 2851:         logical1 *erreur_memoire);
 2852: 
 2853: /*
 2854: --------------------------------------------------------------------------------
 2855:   Routine principale
 2856: --------------------------------------------------------------------------------
 2857: */
 2858: 
 2859: #ifndef RPLARGS
 2860: int rplinit(int argc, char *argv[], unsigned char ***resultats, char *rpl_home);
 2861: #endif
 2862: 
 2863: /*
 2864: --------------------------------------------------------------------------------
 2865:   Routines de statistiques
 2866: --------------------------------------------------------------------------------
 2867: */
 2868: 
 2869: #ifndef RPLARGS
 2870: real8 correlation_statistique(struct_matrice *s_matrice,
 2871:         unsigned long colonne_1, unsigned long colonne_2, logical1 *erreur);
 2872: real8 covariance_statistique(struct_matrice *s_matrice,
 2873:         unsigned long colonne_1, unsigned long colonne_2,
 2874:         unsigned char type, logical1 *erreur);
 2875: struct_vecteur *ecart_type_statistique(struct_matrice *s_matrice,
 2876:         unsigned char type);
 2877: struct_vecteur *moyenne_statistique(struct_matrice *s_matrice);
 2878: struct_vecteur *sommation_colonne_statistique(struct_matrice *s_matrice,
 2879:         unsigned long colonne);
 2880: struct_vecteur *sommation_produits_colonnes_statistiques(struct_matrice
 2881:         *s_matrice, unsigned long colonne_1, unsigned long colonne_2);
 2882: struct_vecteur *sommation_statistique(struct_matrice *s_matrice);
 2883: struct_vecteur *variance_statistique(struct_matrice *s_matrice,
 2884:         unsigned char type);
 2885: #endif
 2886: 
 2887: /*
 2888: --------------------------------------------------------------------------------
 2889:   Gestion des bibliothèques
 2890: --------------------------------------------------------------------------------
 2891: */
 2892: 
 2893: #ifndef RPLARGS
 2894: void *chargement_bibliotheque(struct_processus *s_etat_processus,
 2895:         unsigned char *bibliotheque);
 2896: logical1 execution_fonction_de_bibliotheque(struct_processus *s_etat_processus,
 2897:         unsigned char *nom_fonction, unsigned char *bibliothque);
 2898: logical1 retrait_bibliotheque(struct_processus *s_etat_processus,
 2899:         struct_bibliotheque *descripteur);
 2900: #endif
 2901: 
 2902: struct_liste_chainee *depilement_pile_operationnelle(struct_rpl_arguments
 2903:         *s_rpl_arguments, struct_objet **s_objet);
 2904: struct_liste_chainee *empilement_pile_operationnelle(struct_rpl_arguments
 2905:         *s_rpl_arguments, struct_objet *s_objet);
 2906: struct_liste_chainee *sauvegarde_arguments(struct_rpl_arguments
 2907:         *s_rpl_arguments, unsigned long nombre_arguments);
 2908: 
 2909: /*
 2910: --------------------------------------------------------------------------------
 2911:   Fonctions retournant un CHARACTER*(*)
 2912: --------------------------------------------------------------------------------
 2913: */
 2914: 
 2915: #ifndef RPLARGS
 2916: unsigned char *analyse_algebrique(struct_processus *s_etat_processus,
 2917:         unsigned char *chaine_algebrique, struct_liste_chainee **l_base_liste);
 2918: unsigned char *recherche_chemin_fichiers_temporaires(struct_processus
 2919:         *s_etat_processus);
 2920: unsigned char *compactage(unsigned char *chaine);
 2921: unsigned char *conversion_majuscule(unsigned char *chaine);
 2922: unsigned char *creation_nom_fichier(struct_processus *s_etat_processus,
 2923:         unsigned char *chemin);
 2924: unsigned char *extraction_chaine(unsigned char *chaine, unsigned long i,
 2925:         unsigned long j);
 2926: unsigned char *formateur(struct_processus *s_etat_processus, long offset,
 2927:         struct_objet *s_objet);
 2928: unsigned char *formateur_fichier(struct_processus *s_etat_processus,
 2929:         struct_objet *s_objet, struct_objet *s_format,
 2930:         long longueur, long longueur_champ, unsigned char format,
 2931:         unsigned char type, long *longueur_effective, long *recursivite);
 2932: unsigned char *formateur_fichier_nombre(struct_processus *s_etat_processus,
 2933:         void *valeur_numerique, unsigned char type,
 2934:         long longueur, long longueur_champ, unsigned char format);
 2935: unsigned char *formateur_fichier_reel(struct_processus *s_etat_processus,
 2936:         void *valeur_numerique, unsigned char type,
 2937:         long longueur, long longueur_champ, unsigned char format);
 2938: unsigned char *formateur_nombre(struct_processus *s_etat_processus,
 2939:         void *valeur_numerique, unsigned char type);
 2940: unsigned char *formateur_reel(struct_processus *s_etat_processus,
 2941:         void *valeur_numerique, unsigned char type);
 2942: unsigned char *messages(struct_processus *s_etat_processus);
 2943: unsigned char *purification_chaine(unsigned char *chaine);
 2944: unsigned char *reencodage(struct_processus *s_etat_processus,
 2945:         unsigned char *chaine_entree, unsigned char *codage_entree,
 2946:         unsigned char *codage_sortie);
 2947: unsigned char *transliteration(struct_processus *s_etat_processus,
 2948:         unsigned char *chaine_entree, unsigned char *codage_entree,
 2949:         unsigned char *codage_sortie);
 2950: #endif
 2951: 
 2952: /*
 2953: --------------------------------------------------------------------------------
 2954:   Fonctions retournant un INTEGER*1 (drapeau d'erreur)
 2955: --------------------------------------------------------------------------------
 2956: */
 2957: 
 2958: #ifndef RPLARGS
 2959: logical1 analyse_syntaxique(struct_processus *s_etat_processus);
 2960: logical1 caracteristiques_fichier(struct_processus *s_etat_processus,
 2961:         unsigned char *nom, logical1 *existence, logical1 *ouverture,
 2962:         unsigned long *unite);
 2963: logical1 controle(struct_processus *s_etat_processus, unsigned char *fichier,
 2964:         unsigned char *type, unsigned char *somme_candidate);
 2965: logical1 creation_variable(struct_processus *s_etat_processus,
 2966:         struct_variable *s_variable,
 2967:         unsigned char autorisation_creation_variable_statique,
 2968:         unsigned char autorisation_creation_variable_partagee);
 2969: logical1 creation_variable_partagee(struct_processus *s_etat_processus,
 2970:         struct_variable_partagee *s_variable);
 2971: logical1 creation_variable_statique(struct_processus *s_etat_processus,
 2972:         struct_variable_statique *s_variable);
 2973: logical1 chainage(struct_processus *s_etat_processus);
 2974: logical1 compilation(struct_processus *s_etat_processus);
 2975: logical1 depilement(struct_processus *s_etat_processus,
 2976:         struct_liste_chainee **l_base_liste, struct_objet **s_objet);
 2977: logical1 destruction_fichier(unsigned char *nom_fichier);
 2978: logical1 empilement(struct_processus *s_etat_processus,
 2979:         struct_liste_chainee **l_base_liste, struct_objet *s_objet);
 2980: logical1 empilement_pile_last(struct_processus *s_etat_processus,
 2981:         unsigned long nombre_arguments);
 2982: logical1 evaluation(struct_processus *s_etat_processus, struct_objet *s_objet,
 2983:         unsigned char type_evaluation);
 2984: logical1 initialisation_fichier_acces_direct(struct_processus *s_etat_processus,
 2985:         sqlite3 *sqlite, logical1 binaire);
 2986: logical1 initialisation_fichier_acces_indexe(struct_processus *s_etat_processus,
 2987:         sqlite3 *sqlite, integer8 position_clef, logical1 binaire);
 2988: logical1 recherche_instruction_suivante(struct_processus *s_etat_processus);
 2989: logical1 retrait_variable(struct_processus *s_etat_processus,
 2990:         unsigned char *nom_variable, unsigned char type);
 2991: logical1 retrait_variable_par_niveau(struct_processus *s_etat_processus);
 2992: logical1 retrait_variable_partagee(struct_processus *s_etat_processus,
 2993:         unsigned char *nom_variable, union_position_variable position);
 2994: logical1 retrait_variable_statique(struct_processus *s_etat_processus,
 2995:         unsigned char *nom_variable, union_position_variable position);
 2996: logical1 sequenceur(struct_processus *s_etat_processus);
 2997: logical1 sequenceur_optimise(struct_processus *s_etat_processus);
 2998: #endif
 2999: 
 3000: /*
 3001: --------------------------------------------------------------------------------
 3002:   Fonctions retournant un INTEGER*1 (drapeau)
 3003: --------------------------------------------------------------------------------
 3004: */
 3005: 
 3006: logical1 depassement_addition(integer8 *a, integer8 *b, integer8 *resultat);
 3007: logical1 depassement_multiplication(integer8 *a, integer8 *b,
 3008:         integer8 *resultat);
 3009: logical1 depassement_puissance(integer8 *a, integer8 *b, integer8 *resultat);
 3010: 
 3011: #ifndef RPLARGS
 3012: logical1 ecriture_pipe(struct_processus *s_etat_processus, int pipe,
 3013:         struct_objet *s_objet);
 3014: logical1 recherche_variable(struct_processus *s_etat_processus,
 3015:         unsigned char *nom_variable);
 3016: logical1 recherche_variable_partagee(struct_processus *s_etat_processus,
 3017:         unsigned char *nom_variable, union_position_variable position,
 3018:         unsigned char origine);
 3019: logical1 recherche_variable_statique(struct_processus *s_etat_processus,
 3020:         unsigned char *nom_variable, union_position_variable position,
 3021:         unsigned char origine);
 3022: logical1 test_cfsf(struct_processus *s_etat_processus,
 3023:         unsigned char indice_drapeau);
 3024: logical1 test_expression_rpn(unsigned char *chaine);
 3025: logical1 test_fonction(unsigned char *chaine);
 3026: #endif
 3027: 
 3028: /*
 3029: --------------------------------------------------------------------------------
 3030:   Fonctions retournant un ssize_t
 3031: --------------------------------------------------------------------------------
 3032: */
 3033: 
 3034: #ifndef RPLARGS
 3035: ssize_t read_atomic(struct_processus *s_etat_processus,
 3036:         int fd, void *buf, size_t count);
 3037: ssize_t write_atomic(struct_processus *s_etat_processus,
 3038:         int fd, void *buf, size_t count);
 3039: #endif
 3040: 
 3041: /*
 3042: --------------------------------------------------------------------------------
 3043:   Fonctions renvoyant un int
 3044: --------------------------------------------------------------------------------
 3045: */
 3046: 
 3047: int alsprintf(unsigned char **strp, const char *fmt, ...);
 3048: int tex_fprintf(struct_processus *s_etat_processus,
 3049:         file *flux, const char *format, ...);
 3050: int transliterated_fprintf(struct_processus *s_etat_processus, file *flux,
 3051:         const char *format, ...);
 3052: int valsprintf(unsigned char **strp, const char *fmt, va_list ap);
 3053: int wrapper_instruction_intrinseque(void (*fonction)(),
 3054:         struct_rpl_arguments *rpl_arguments);
 3055: 
 3056: /*
 3057: --------------------------------------------------------------------------------
 3058:   Fonctions renvoyant un INTEGER*1 (longueur d'un entier binaire)
 3059: --------------------------------------------------------------------------------
 3060: */
 3061: 
 3062: #ifndef RPLARGS
 3063: unsigned char longueur_entiers_binaires(struct_processus *s_etat_processus);
 3064: unsigned char recherche_longueur_optimale(integer8 parametre);
 3065: #endif
 3066: 
 3067: /*
 3068: --------------------------------------------------------------------------------
 3069:   Fonctions retournant un INTEGER*8 (valeur binaire non signée)
 3070: --------------------------------------------------------------------------------
 3071: */
 3072: 
 3073: #ifndef RPLARGS
 3074: logical8 masque_entiers_binaires(struct_processus *s_etat_processus);
 3075: #endif
 3076: 
 3077: /*
 3078: --------------------------------------------------------------------------------
 3079:   Fonctions retournant un INTEGER*8 (entier standard RPL/2)
 3080: --------------------------------------------------------------------------------
 3081: */
 3082: 
 3083: #ifndef RPLARGS
 3084: integer8 occupation_memoire(struct_objet *s_objet);
 3085: #endif
 3086: 
 3087: /*
 3088: --------------------------------------------------------------------------------
 3089:   Fonctions renvoyant une liste chaînée (pointeur sur *struct_liste_chainee)
 3090: --------------------------------------------------------------------------------
 3091: */
 3092: 
 3093: #ifndef RPLARGS
 3094: struct_liste_chainee *analyse_rpn(struct_processus *s_etat_processus,
 3095:         unsigned char *chaine_rpn);
 3096: #endif
 3097: 
 3098: /*
 3099: --------------------------------------------------------------------------------
 3100:   Fonctions renvoyant une copie de la structure de description des processus
 3101: --------------------------------------------------------------------------------
 3102: */
 3103: 
 3104: #ifndef RPLARGS
 3105: struct_processus *copie_etat_processus(struct_processus *s_etat_processus);
 3106: #endif
 3107: 
 3108: /*
 3109: --------------------------------------------------------------------------------
 3110:   Fonctions renvoyant un pointeur sur un fichier (file *) ou un descripteur
 3111: --------------------------------------------------------------------------------
 3112: */
 3113: 
 3114: #ifndef RPLARGS
 3115: file *creation_fichier_tex(struct_processus *s_etat_processus);
 3116: struct_descripteur_fichier *descripteur_fichier(struct_processus
 3117:         *s_etat_processus, struct_fichier *s_fichier);
 3118: #endif
 3119: 
 3120: /*
 3121: --------------------------------------------------------------------------------
 3122:   Fonctions renvoyant un pointeur sur une *struct_objet
 3123: --------------------------------------------------------------------------------
 3124: */
 3125: 
 3126: struct_objet *copie_objet(struct_processus *s_etat_processus,
 3127:         struct_objet *s_objet, unsigned char type);
 3128: 
 3129: #ifndef RPLARGS
 3130: struct_objet *formateur_date(struct_processus *s_etat_processus,
 3131:         struct timeval *temps);
 3132: struct_objet *lecture_pipe(struct_processus *s_etat_processus, int pipe);
 3133: struct_objet *parametres_sql(struct_processus *s_etat_processus,
 3134:         struct_objet *s_parametres);
 3135: struct_objet *simplification(struct_processus *s_etat_processus,
 3136:         struct_objet *s_objet);
 3137: #endif
 3138: 
 3139: /*
 3140: --------------------------------------------------------------------------------
 3141:   Fonctions gérant les arbres de simplification
 3142: --------------------------------------------------------------------------------
 3143: */
 3144: 
 3145: #ifndef RPLARGS
 3146: struct_arbre *creation_arbre(struct_processus *s_etat_processus,
 3147:         struct_objet **t_objets, unsigned long indice,
 3148:         unsigned long indice_maximal);
 3149: void liberation_arbre(struct_processus *s_etat_processus,
 3150:         struct_arbre *s_noeud);
 3151: void parcours_arbre(struct_processus *s_etat_processus, struct_arbre *s_noeud);
 3152: void simplification_arbre(struct_processus *s_etat_processus,
 3153:         struct_arbre *s_noeud);
 3154: #endif
 3155: 
 3156: /*
 3157: --------------------------------------------------------------------------------
 3158:   Fonctions gérant la complétion automatique
 3159: --------------------------------------------------------------------------------
 3160: */
 3161: 
 3162: char **completion_rpl();
 3163: char *generateur_commandes();
 3164: char **completion_matches();
 3165: 
 3166: // END C PROTOTYPES
 3167: 
 3168: /*
 3169: --------------------------------------------------------------------------------
 3170:   Arithmétique
 3171: --------------------------------------------------------------------------------
 3172: */
 3173: 
 3174: void f77absc_(complex16 *c, real8 *resultat);
 3175: 
 3176: void f77additioncc_(complex16 *ca, complex16 *cb, complex16 *resultat);
 3177: void f77additionci_(complex16 *ca, integer8 *ib, complex16 *resultat);
 3178: void f77additioncr_(complex16 *ca, real8 *rb, complex16 *resultat);
 3179: 
 3180: void f77divisioncc_(complex16 *ca, complex16 *rb, complex16 *resultat);
 3181: void f77divisionci_(complex16 *ca, integer8 *ib, complex16 *resultat);
 3182: void f77divisioncr_(complex16 *ca, real8 *rb, complex16 *resultat);
 3183: void f77divisionic_(integer8 *ib, complex16 *cb, complex16 *resultat);
 3184: void f77divisionrc_(real8 *ra, complex16 *cb, complex16 *resultat);
 3185: 
 3186: void f77multiplicationcc_(complex16 *ca, complex16 *cb, complex16 *resultat);
 3187: void f77multiplicationci_(complex16 *ca, integer8 *ib, complex16 *resultat);
 3188: void f77multiplicationcr_(complex16 *ca, real8 *rb, complex16 *resultat);
 3189: 
 3190: void f77puissancecc_(complex16 *ca, complex16 *cb, complex16 *resultat);
 3191: void f77puissanceci_(complex16 *ca, integer8 *ib, complex16 *resultat,
 3192:         integer4 *troncature);
 3193: void f77puissancecr_(complex16 *ca, real8 *rb, complex16 *resultat);
 3194: void f77puissanceic_(integer8 *ia, complex16 *cb, complex16 *resultat);
 3195: void f77puissanceii_(integer8 *ia, integer8 *ib, integer8 *resultat);
 3196: void f77puissanceir_(integer8 *ia, real8 *rb, real8 *resultat);
 3197: void f77puissancerc_(real8 *ra, complex16 *cb, complex16 *resultat);
 3198: void f77puissanceri_(real8 *ra, integer8 *ib, real8 *resultat,
 3199:         integer4 *troncature);
 3200: void f77puissancerr_(real8 *ra, real8 *rb, real8 *resultat);
 3201: 
 3202: void f77racinecarreec_(complex16 *ca, complex16 *resultat);
 3203: void f77racinecarreein_(integer8 *ia, complex16 *resultat);
 3204: void f77racinecarreeip_(integer8 *ia, real8 *resultat);
 3205: void f77racinecarreern_(real8 *ia, complex16 *resultat);
 3206: void f77racinecarreerp_(real8 *ia, real8 *resultat);
 3207: 
 3208: void f77soustractioncc_(complex16 *ca, complex16 *cb, complex16 *resultat);
 3209: void f77soustractionci_(complex16 *ca, integer8 *ib, complex16 *resultat);
 3210: void f77soustractioncr_(complex16 *ca, real8 *rb, complex16 *resultat);
 3211: void f77soustractionic_(integer8 *ib, complex16 *cb, complex16 *resultat);
 3212: void f77soustractionrc_(real8 *ra, complex16 *cb, complex16 *resultat);
 3213: 
 3214: /*
 3215: --------------------------------------------------------------------------------
 3216:   Trigonométrie complexe
 3217: --------------------------------------------------------------------------------
 3218: */
 3219: 
 3220: void f77acos_(complex16 *argument, complex16 *resultat);
 3221: void f77asin_(complex16 *argument, complex16 *resultat);
 3222: void f77atan_(complex16 *argument, complex16 *resultat, integer4 *erreur);
 3223: void f77cos_(complex16 *argument, complex16 *resultat);
 3224: void f77sin_(complex16 *argument, complex16 *resultat);
 3225: void f77tan_(complex16 *argument, complex16 *resultat, integer4 *erreur);
 3226: 
 3227: /*
 3228: --------------------------------------------------------------------------------
 3229:   Fonctions hyperboliques
 3230: --------------------------------------------------------------------------------
 3231: */
 3232: 
 3233: void f77acoshc_(complex16 *argument, complex16 *resultat);
 3234: void f77alogc_(complex16 *argument, complex16 *resultat);
 3235: void f77asinhc_(complex16 *argument, complex16 *resultat);
 3236: void f77atanhc_(complex16 *argument, complex16 *resultat);
 3237: void f77cosh_(complex16 *argument, complex16 *resultat);
 3238: void f77expc_(complex16 *argument, complex16 *resultat);
 3239: void f77lnc_(complex16 *argument, complex16 *resultat, integer4 *erreur);
 3240: void f77lnin_(integer8 *argument, complex16 *resultat, integer4 *erreur);
 3241: void f77lnrn_(real8 *argument, complex16 *resultat, integer4 *erreur);
 3242: void f77logc_(complex16 *argument, complex16 *resultat, integer4 *erreur);
 3243: void f77login_(integer8 *argument, complex16 *resultat, integer4 *erreur);
 3244: void f77logrn_(real8 *argument, complex16 *resultat, integer4 *erreur);
 3245: void f77sinh_(complex16 *argument, complex16 *resultat);
 3246: void f77tanh_(complex16 *argument, complex16 *resultat, integer4 *erreur);
 3247: void f77acoshi_(integer8 *argument, real8 *resultat);
 3248: void f77acoshr_(real8 *argument, real8 *resultat);
 3249: void f77asinhi_(integer8 *argument, real8 *resultat);
 3250: void f77asinhr_(real8 *argument, real8 *resultat);
 3251: void f77atanhi_(integer8 *argument, real8 *resultat);
 3252: void f77atanhr_(real8 *argument, real8 *resultat);
 3253: void f77lnip_(integer8 *argument, real8 *resultat, integer4 *erreur);
 3254: void f77lnrp_(real8 *argument, real8 *resultat, integer4 *erreur);
 3255: void f77logip_(integer8 *argument, real8 *resultat, integer4 *erreur);
 3256: void f77logrp_(real8 *argument, real8 *resultat, integer4 *erreur);
 3257: 
 3258: /*
 3259: --------------------------------------------------------------------------------
 3260:   Calculs divers
 3261: --------------------------------------------------------------------------------
 3262: */
 3263: 
 3264: void f90arrangement(integer8 *n, integer8 *k, real8 *resultat);
 3265: void f90combinaison(integer8 *n, integer8 *k, real8 *resultat);
 3266: void f90fcd(real8 *x, integer8 *n1, integer8 *n2, real8 *resultat);
 3267: void f90gausscd(real8 *x, real8 *moyenne, real8 *variance, real8 *resultat);
 3268: void f90tcd(real8 *x, integer8 *n, real8 *resultat);
 3269: void f90x2cd(real8 *x, integer8 *n, real8 *resultat);
 3270: 
 3271: // BEGIN C PROTOTYPES
 3272: void dft(complex16 *dft, integer4 *nombre_lignes, integer4 *nombre_colonnes,
 3273:         integer4 *inverse, integer4 *erreur);
 3274: // END C PROTOTYPES
 3275: 
 3276: /*
 3277: --------------------------------------------------------------------------------
 3278:   Fonctions Lapack
 3279: --------------------------------------------------------------------------------
 3280: */
 3281: 
 3282:     /*
 3283:      * Calcul de la longueur d'un espace de travail
 3284:      */
 3285: 
 3286: #ifndef RPLARGS
 3287: integer4 ilaenv_(integer4 *optimal, char *nom_fonction, char *option,
 3288:         integer4 *n1, integer4 *n2, integer4 *n3, integer4 *n4,
 3289:         integer4 longueur_nom_fonction, integer4 longueur_option);
 3290: 
 3291:     /*
 3292:      * Inversion
 3293:      */
 3294: 
 3295: void dgetri_(integer4 *ordre_a, real8 *a, integer4 *lda, integer4 *pivot,
 3296:         real8 *work, integer4 *dim_work, integer4 *ios);
 3297: void zgetri_(integer4 *ordre_a, complex16 *a, integer4 *lda, integer4 *pivot,
 3298:         complex16 *work, integer4 *dim_work, integer4 *ios);
 3299: 
 3300:     /*
 3301:      * Valeurs propres
 3302:      */
 3303: 
 3304: void zgeev_(unsigned char *calcul_vp_gauches, unsigned char *calcul_vp_droits,
 3305:         integer4 *dim_matrice1, complex16 *matrice_f77,
 3306:         integer4 *dim_matrice2, complex16 *valeurs_propres,
 3307:         complex16 *vpg_f77, integer4 *dim_matrice3,
 3308:         complex16 *vpd_f77, integer4 *dim_matrice4,
 3309:         complex16 *work, integer4 *lwork, real8 *rwork,
 3310:         integer4 *erreur, integer4 longueur_1, integer4 longueur_2);
 3311: 
 3312:     /*
 3313:      * Valeurs propres généralisées
 3314:      */
 3315: 
 3316: void zggev_(unsigned char *calcul_vp_gauches, unsigned char *calcul_vp_droits,
 3317:         integer4 *dim_matrice1, complex16 *matrice_f77,
 3318:         integer4 *dim_matrice2, complex16 *metrique_f77,
 3319:         integer4 *dim_matrice3, complex16 *alpha, complex16 *beta,
 3320:         complex16 *vpg_f77, integer4 *dim_matrice4,
 3321:         complex16 *vpd_f77, integer4 *dim_matrice5,
 3322:         complex16 *work, integer4 *lwork, real8 *rwork,
 3323:         integer4 *erreur, integer4 longueur_1, integer4 longueur_2);
 3324: 
 3325:     /*
 3326:      * Moindres carrés
 3327:      */
 3328: 
 3329: void dgelsd_(integer4 *nombre_lignes_a, integer4 *nombre_colonnes_a,
 3330:         integer4 *nombre_colonnes_b, real8 *matrice_a, integer4 *lda,
 3331:         real8 *matrice_b, integer4 *ldb, real8 *valeurs_singulieres,
 3332:         real8 *rcond, integer4 *rank, real8 *work, integer4 *lwork,
 3333:         integer4 *iwork, integer4 *info);
 3334: void zgelsd_(integer4 *nombre_lignes_a, integer4 *nombre_colonnes_a,
 3335:         integer4 *nombre_colonnes_b, complex16 *matrice_a, integer4 *lda,
 3336:         complex16 *matrice_b, integer4 *ldb, real8 *valeurs_singulieres,
 3337:         real8 *rcond, integer4 *rank, complex16 *work, integer4 *lwork,
 3338:         real8 *rwork, integer4 *iwork, integer4 *info);
 3339: 
 3340:     /*
 3341:      * Moindres carrés généralisé
 3342:      */
 3343: 
 3344:     /*
 3345:      * Décomposition en valeurs singulières
 3346:      */
 3347: 
 3348: void dgesvd_(unsigned char *jobu, unsigned char *jobvh,
 3349:         integer4 *m, integer4 *n, real8 *a, integer4 *lda,
 3350:         real8 *s, real8 *u, integer4 *ldu, real8 *vh, integer4 *ldvh,
 3351:         real8 *work, integer4 *lwork, integer4 *info, integer4 longueur_jobu,
 3352:         integer4 longueur_jobvh);
 3353: void zgesvd_(unsigned char *jobu, unsigned char *jobvh,
 3354:         integer4 *m, integer4 *n, real8 *a, integer4 *lda,
 3355:         real8 *s, real8 *u, integer4 *ldu, real8 *vh, integer4 *ldvh,
 3356:         real8 *work, integer4 *lwork, real8 *rwork, integer4 *info,
 3357:         integer4 longueur_jobu, integer4 longueur_jobvh);
 3358: 
 3359:     /*
 3360:      * Factorisations diverses
 3361:      */
 3362: 
 3363:         /* LU de Crout */
 3364: void dgetrf_(integer4 *nb_lignes_a, integer4 *nb_colonnes_a, real8 *a,
 3365:         integer4 *lda, integer4 *pivot, integer4 *ios);
 3366: void zgetrf_(integer4 *nb_lignes_a, integer4 *nb_colonnes_a, complex16 *a,
 3367:         integer4 *lda, integer4 *pivot, integer4 *ios);
 3368: 
 3369:         /* LQ */
 3370: void dgelq2_(integer4 *nb_lignes_a, integer4 *nb_colonnes_a, real8 *a,
 3371:         integer4 *lda, real8 *tau, real8 *work, integer4 *ios);
 3372: void zgelq2_(integer4 *nb_lignes_a, integer4 *nb_colonnes_a, complex16 *a,
 3373:         integer4 *lda, complex16 *tau, complex16 *work, integer4 *ios);
 3374: 
 3375:         /* QR */
 3376: void dgeqp3_(integer4 *nb_lignes_a, integer4 *nb_colonnes_a, real8 *a,
 3377:         integer4 *lda, integer4 *pivot, real8 *tau, real8 *work,
 3378:         integer4 *lwork, integer4 *ios);
 3379: void zgeqp3_(integer4 *nb_lignes_a, integer4 *nb_colonnes_a, complex16 *a,
 3380:         integer4 *lda, integer4 *pivot, complex16 *tau, complex16 *work,
 3381:         integer4 *lwork, real8 *rwork, integer4 *ios);
 3382: 
 3383:         /* Cholesky */
 3384: void dpptrf_(unsigned char *mode, integer4 *n, complex16 *triangle,
 3385:         integer4 *ios, integer4 longueur);
 3386: void zpptrf_(unsigned char *mode, integer4 *n, complex16 *triangle,
 3387:         integer4 *ios, integer4 longueur);
 3388: 
 3389:         /* Schur */
 3390: void dgees_(unsigned char *calcul_vecteur, unsigned char *valeurs_triees,
 3391:         logical4 (*fonction_tri)(), integer4 *n, real8 *a,
 3392:         integer4 *lda, integer4 *sdim, real8 *wr, real8 *wi,
 3393:         real8 *vs, integer4 *ldvs, real8 *work, integer4 *lwork,
 3394:         logical4 *bwork, integer4 *info, integer4 l1, integer4 l2);
 3395: void zgees_(unsigned char *calcul_vecteur, unsigned char *valeurs_triees,
 3396:         logical4 (*fonction_tri)(), integer4 *n, complex16 *a,
 3397:         integer4 *lda, integer4 *sdim, complex16 *w,
 3398:         complex16 *vs, integer4 *ldvs, complex16 *work, integer4 *lwork,
 3399:         real8 *rwork, logical4 *bwork, integer4 *info,
 3400:         integer4 l1, integer4 l2);
 3401: 
 3402:         /* Déterminant et rang */
 3403: void dgecon_(unsigned char *norm, integer4 *n, real8 *a, integer4 *lda,
 3404:         real8 *anorm, real8 *rcond, real8 *work, integer4 *iwork,
 3405:         integer4 *info, integer4 l1);
 3406: void dgelsy_(integer4 *m, integer4 *n, integer4 *nrhs, real8 *a,
 3407:         integer4 *lda, real8 *b, integer4 *ldb, integer4 *jpvt, real8 *rcond,
 3408:         integer4 *rank, real8 *work, integer4 *lwork, integer4 *info);
 3409: real8 dlange_(unsigned char *norme, integer4 *n, integer4 *m, real8 *a,
 3410:         integer4 *lda, real8 *work, integer4 longueur);
 3411: real8 zlange_(unsigned char *norme, integer4 *n, integer4 *m, real8 *a,
 3412:         integer4 *lda, real8 *work, integer4 longueur);
 3413: void zgecon_(unsigned char *norm, integer4 *n, complex16 *a, integer4 *lda,
 3414:         real8 *anorm, real8 *rcond, complex16 *work, real8 *rwork,
 3415:         integer4 *info, integer4 l1);
 3416: void zgelsy_(integer4 *m, integer4 *n, integer4 *nrhs, complex16 *a,
 3417:         integer4 *lda, complex16 *b, integer4 *ldb, integer4 *jpvt,
 3418:         real8 *rcond, integer4 *rank, complex16 *work, integer4 *lwork,
 3419:         real8 *rwork, integer4 *info);
 3420: #endif
 3421: 
 3422: /*
 3423:  * Fonction testant la requête d'arrêt (nécessaire pour tester le
 3424:  * drapeau depuis une bibliothèque).
 3425:  */
 3426: 
 3427: int test_arret(struct_processus *s_etat_processus);
 3428: 
 3429: #endif
 3430: 
 3431: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>