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

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

CVSweb interface <joel.bertrand@systella.fr>