Annotation of rpl/src/rpl.h, revision 1.174

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

CVSweb interface <joel.bertrand@systella.fr>