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

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

CVSweb interface <joel.bertrand@systella.fr>