Annotation of rpl/src/instructions_c4.c, revision 1.34

1.1       bertrand    1: /*
                      2: ================================================================================
1.34    ! bertrand    3:   RPL/2 (R) version 4.1.5
1.18      bertrand    4:   Copyright (C) 1989-2011 Dr. BERTRAND Joël
1.1       bertrand    5: 
                      6:   This file is part of RPL/2.
                      7: 
                      8:   RPL/2 is free software; you can redistribute it and/or modify it
                      9:   under the terms of the CeCILL V2 License as published by the french
                     10:   CEA, CNRS and INRIA.
                     11:  
                     12:   RPL/2 is distributed in the hope that it will be useful, but WITHOUT
                     13:   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
                     14:   FITNESS FOR A PARTICULAR PURPOSE.  See the CeCILL V2 License
                     15:   for more details.
                     16:  
                     17:   You should have received a copy of the CeCILL License
                     18:   along with RPL/2. If not, write to info@cecill.info.
                     19: ================================================================================
                     20: */
                     21: 
                     22: 
1.14      bertrand   23: #include "rpl-conv.h"
                     24: #include "convert-conv.h"
1.1       bertrand   25: 
                     26: 
                     27: /*
                     28: ================================================================================
                     29:   Fonction 'cov'
                     30: ================================================================================
                     31:   Entrées :
                     32: --------------------------------------------------------------------------------
                     33:   Sorties :
                     34: --------------------------------------------------------------------------------
                     35:   Effets de bord : néant
                     36: ================================================================================
                     37: */
                     38: 
                     39: void
                     40: instruction_cov(struct_processus *s_etat_processus)
                     41: {
                     42:    integer8                            nombre_colonnes;
                     43: 
                     44:    logical1                            erreur;
                     45: 
                     46:    struct_objet                        *s_objet_statistique;
                     47:    struct_objet                        *s_objet_resultat;
                     48: 
                     49:    (*s_etat_processus).erreur_execution = d_ex;
                     50: 
                     51:    if ((*s_etat_processus).affichage_arguments == 'Y')
                     52:    {
                     53:        printf("\n  COV ");
                     54: 
                     55:        if ((*s_etat_processus).langue == 'F')
                     56:        {
                     57:            printf("(covariance)\n\n");
                     58:        }
                     59:        else
                     60:        {
                     61:            printf("(covariance)\n\n");
                     62:        }
                     63: 
                     64:        printf("->  1: %s\n", d_REL);
                     65: 
                     66:        return;
                     67:    }
                     68:    else if ((*s_etat_processus).test_instruction == 'Y')
                     69:    {
                     70:        (*s_etat_processus).nombre_arguments = -1;
                     71:        return;
                     72:    }
                     73:    
                     74:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                     75:    {
                     76:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
                     77:        {
                     78:            return;
                     79:        }
                     80:    }
                     81: 
                     82:    /*
                     83:     * Recherche d'une variable globale référencée par SIGMA
                     84:     */
                     85: 
1.22      bertrand   86:    if (recherche_variable_globale(s_etat_processus, ds_sdat) == d_faux)
1.1       bertrand   87:    {
                     88:        /*
                     89:         * Aucune variable SIGMA
                     90:         */
                     91: 
                     92:        (*s_etat_processus).erreur_systeme = d_es;
                     93:        (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                     94:        return;
                     95:    }
                     96:    else
                     97:    {
1.22      bertrand   98:        if (((*(*(*s_etat_processus).pointeur_variable_courante).objet)
                     99:                .type != MIN) && ((*(*(*s_etat_processus)
                    100:                .pointeur_variable_courante).objet).type != MRL))
1.1       bertrand  101:        {
1.22      bertrand  102:            (*s_etat_processus).erreur_execution =
                    103:                    d_ex_matrice_statistique_invalide;
1.1       bertrand  104:            return;
                    105:        }
                    106: 
1.22      bertrand  107:        nombre_colonnes = (*((struct_matrice *) (*(*(*s_etat_processus)
                    108:                .pointeur_variable_courante).objet).objet)).nombre_colonnes;
1.1       bertrand  109:    }
                    110: 
1.22      bertrand  111:    s_objet_statistique = (*(*s_etat_processus).pointeur_variable_courante)
                    112:            .objet;
1.1       bertrand  113: 
                    114:    if (((*s_objet_statistique).type == MIN) ||
                    115:            ((*s_objet_statistique).type == MRL))
                    116:    {
                    117:        if (((*s_etat_processus).colonne_statistique_1 < 1) ||
                    118:                ((*s_etat_processus).colonne_statistique_2 < 1) ||
                    119:                ((*s_etat_processus).colonne_statistique_1 > nombre_colonnes) ||
                    120:                ((*s_etat_processus).colonne_statistique_2 > nombre_colonnes))
                    121:        {
                    122:            (*s_etat_processus).erreur_execution =
                    123:                    d_ex_observations_inexistantes;
                    124:            return;
                    125:        }
                    126: 
                    127:        if ((s_objet_resultat = allocation(s_etat_processus, REL))
                    128:                == NULL)
                    129:        {
                    130:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    131:            return;
                    132:        }
                    133: 
                    134:        (*((real8 *) (*s_objet_resultat).objet)) = covariance_statistique(
                    135:                (struct_matrice *) (*s_objet_statistique).objet,
                    136:                (*s_etat_processus).colonne_statistique_1,
                    137:                (*s_etat_processus).colonne_statistique_2, 'E', &erreur);
                    138: 
                    139:        if (erreur == d_erreur)
                    140:        {
                    141:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    142:            return;
                    143:        }
                    144:    }
                    145:    else
                    146:    {
                    147:        (*s_etat_processus).erreur_execution =
                    148:                d_ex_matrice_statistique_invalide;
                    149:        return;
                    150:    }
                    151: 
                    152:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    153:            s_objet_resultat) == d_erreur)
                    154:    {
                    155:        return;
                    156:    }
                    157: 
                    158:    return;
                    159: }
                    160: 
                    161: 
                    162: /*
                    163: ================================================================================
                    164:   Fonction 'corr'
                    165: ================================================================================
                    166:   Entrées :
                    167: --------------------------------------------------------------------------------
                    168:   Sorties :
                    169: --------------------------------------------------------------------------------
                    170:   Effets de bord : néant
                    171: ================================================================================
                    172: */
                    173: 
                    174: void
                    175: instruction_corr(struct_processus *s_etat_processus)
                    176: {
                    177:    logical1                            erreur;
                    178: 
                    179:    struct_objet                        *s_objet_statistique;
                    180:    struct_objet                        *s_objet_resultat;
                    181: 
                    182:    unsigned long                       nombre_colonnes;
                    183: 
                    184:    (*s_etat_processus).erreur_execution = d_ex;
                    185: 
                    186:    if ((*s_etat_processus).affichage_arguments == 'Y')
                    187:    {
                    188:        printf("\n  CORR ");
                    189: 
                    190:        if ((*s_etat_processus).langue == 'F')
                    191:        {
                    192:            printf("(corrélation)\n\n");
                    193:        }
                    194:        else
                    195:        {
                    196:            printf("(correlation)\n\n");
                    197:        }
                    198: 
                    199:        printf("->  1: %s\n", d_REL);
                    200: 
                    201:        return;
                    202:    }
                    203:    else if ((*s_etat_processus).test_instruction == 'Y')
                    204:    {
                    205:        (*s_etat_processus).nombre_arguments = -1;
                    206:        return;
                    207:    }
                    208:    
                    209:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                    210:    {
                    211:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
                    212:        {
                    213:            return;
                    214:        }
                    215:    }
                    216: 
                    217:    /*
                    218:     * Recherche d'une variable globale référencée par SIGMA
                    219:     */
                    220: 
1.22      bertrand  221:    if (recherche_variable_globale(s_etat_processus, ds_sdat) == d_faux)
1.1       bertrand  222:    {
                    223:        /*
                    224:         * Aucune variable SIGMA
                    225:         */
                    226: 
                    227:        (*s_etat_processus).erreur_systeme = d_es;
                    228:        (*s_etat_processus).erreur_execution = d_ex_absence_observations;
                    229:        return;
                    230:    }
                    231:    else
                    232:    {
1.22      bertrand  233:        if (((*(*(*s_etat_processus).pointeur_variable_courante).objet)
                    234:                .type != MIN) && ((*(*(*s_etat_processus)
                    235:                .pointeur_variable_courante).objet).type != MRL))
1.1       bertrand  236:        {
1.22      bertrand  237:            (*s_etat_processus).erreur_execution =
                    238:                    d_ex_matrice_statistique_invalide;
1.1       bertrand  239:            return;
                    240:        }
                    241: 
1.22      bertrand  242:        nombre_colonnes = (*((struct_matrice *) (*(*(*s_etat_processus)
                    243:                .pointeur_variable_courante).objet).objet))
                    244:                .nombre_colonnes;
1.1       bertrand  245:    }
                    246: 
1.22      bertrand  247:    s_objet_statistique = (*(*s_etat_processus).pointeur_variable_courante)
                    248:            .objet;
1.1       bertrand  249: 
                    250:    if (((*s_objet_statistique).type == MIN) ||
                    251:            ((*s_objet_statistique).type == MRL))
                    252:    {
                    253:        if (((*s_etat_processus).colonne_statistique_1 < 1) ||
                    254:                ((*s_etat_processus).colonne_statistique_2 < 1) ||
                    255:                ((*s_etat_processus).colonne_statistique_1 > (long)
                    256:                nombre_colonnes) || ((*s_etat_processus).colonne_statistique_2
                    257:                > (long) nombre_colonnes))
                    258:        {
                    259:            (*s_etat_processus).erreur_execution =
                    260:                    d_ex_observations_inexistantes;
                    261:            return;
                    262:        }
                    263: 
                    264:        if ((s_objet_resultat = allocation(s_etat_processus, REL))
                    265:                == NULL)
                    266:        {
                    267:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    268:            return;
                    269:        }
                    270: 
                    271:        (*((real8 *) (*s_objet_resultat).objet)) = correlation_statistique(
                    272:                (struct_matrice *) (*s_objet_statistique).objet,
                    273:                (*s_etat_processus).colonne_statistique_1,
                    274:                (*s_etat_processus).colonne_statistique_2, &erreur);
                    275: 
                    276:        if (erreur == d_erreur)
                    277:        {
                    278:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    279:            return;
                    280:        }
                    281:    }
                    282:    else
                    283:    {
                    284:        (*s_etat_processus).erreur_execution =
                    285:                d_ex_matrice_statistique_invalide;
                    286:        return;
                    287:    }
                    288: 
                    289:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    290:            s_objet_resultat) == d_erreur)
                    291:    {
                    292:        return;
                    293:    }
                    294: 
                    295:    return;
                    296: }
                    297: 
                    298: 
                    299: /*
                    300: ================================================================================
                    301:   Fonction 'copyright'
                    302: ================================================================================
                    303:   Entrées :
                    304: --------------------------------------------------------------------------------
                    305:   Sorties :
                    306: --------------------------------------------------------------------------------
                    307:   Effets de bord : néant
                    308: ================================================================================
                    309: */
                    310: 
                    311: void
                    312: instruction_copyright(struct_processus *s_etat_processus)
                    313: {
1.14      bertrand  314: #  include                     "copyright-conv.h"
1.1       bertrand  315: 
                    316:    (*s_etat_processus).erreur_execution = d_ex;
                    317: 
                    318:    if ((*s_etat_processus).affichage_arguments == 'Y')
                    319:    {
                    320:        printf("\n  COPYRIGHT ");
                    321: 
                    322:        if ((*s_etat_processus).langue == 'F')
                    323:        {
                    324:            printf("(copyright)\n\n");
                    325:            printf("  Aucun argument\n");
                    326:        }
                    327:        else
                    328:        {
                    329:            printf("(copyright)\n\n");
                    330:            printf("  No argument\n");
                    331:        }
                    332: 
                    333:        return;
                    334:    }
                    335:    else if ((*s_etat_processus).test_instruction == 'Y')
                    336:    {
                    337:        (*s_etat_processus).nombre_arguments = -1;
                    338:        return;
                    339:    }
                    340:    
                    341:    printf("\n  RPL/2 (R) version %s\n", d_version_rpl);
                    342:    printf("%s\n", ((*s_etat_processus).langue == 'F' )
                    343:            ? copyright : copyright_anglais);
                    344: 
                    345:    if ((*s_etat_processus).hauteur_pile_operationnelle == 0)
                    346:    {
                    347:        printf("\n");
                    348:    }
                    349: 
                    350:    return;
                    351: }
                    352: 
                    353: 
                    354: /*
                    355: ================================================================================
                    356:   Fonction 'convert'
                    357: ================================================================================
                    358:   Entrées :
                    359: --------------------------------------------------------------------------------
                    360:   Sorties :
                    361: --------------------------------------------------------------------------------
                    362:   Effets de bord : néant
                    363: ================================================================================
                    364: */
                    365: 
                    366: void
                    367: instruction_convert(struct_processus *s_etat_processus)
                    368: {
                    369:    file                        *pipe;
                    370: 
                    371:    int                         fin_fichier;
                    372: 
                    373:    logical1                    last_valide;
                    374: 
                    375:    long                        longueur_chaine;
                    376: 
                    377:    logical1                    presence_resultat;
                    378: 
                    379:    struct_objet                *s_objet_argument_1;
                    380:    struct_objet                *s_objet_argument_2;
                    381:    struct_objet                *s_objet_argument_3;
                    382: 
                    383:    unsigned char               *commande;
1.6       bertrand  384:    unsigned char               *executable_candidat;
1.1       bertrand  385:    unsigned char               ligne[1024 + 1];
                    386:    unsigned char               *tampon_instruction;
                    387: 
                    388:    (*s_etat_processus).erreur_execution = d_ex;
                    389: 
                    390:    if ((*s_etat_processus).affichage_arguments == 'Y')
                    391:    {
                    392:        printf("\n  CONVERT ");
                    393: 
                    394:        if ((*s_etat_processus).langue == 'F')
                    395:        {
                    396:            printf("(conversion d'unités)\n\n");
                    397:        }
                    398:        else
                    399:        {
                    400:            printf("(units conversion)\n\n");
                    401:        }
                    402: 
                    403:        printf("    3: %s, %s\n", d_INT, d_REL);
                    404:        printf("    2: %s\n", d_CHN);
                    405:        printf("    1: %s\n", d_CHN);
                    406:        printf("->  2: %s, %s\n", d_INT, d_REL);
                    407:        printf("    1: %s\n", d_CHN);
                    408: 
                    409:        return;
                    410:    }
                    411:    else if ((*s_etat_processus).test_instruction == 'Y')
                    412:    {
                    413:        (*s_etat_processus).nombre_arguments = -1;
                    414:        return;
                    415:    }
                    416: 
                    417:    if ((last_valide = test_cfsf(s_etat_processus, 31)) == d_vrai)
                    418:    {
                    419:        if (empilement_pile_last(s_etat_processus, 3) == d_erreur)
                    420:        {
                    421:            return;
                    422:        }
                    423:    }
                    424: 
                    425:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    426:            &s_objet_argument_1) == d_erreur)
                    427:    {
                    428:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                    429:        return;
                    430:    }
                    431: 
                    432:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    433:            &s_objet_argument_2) == d_erreur)
                    434:    {
                    435:        liberation(s_etat_processus, s_objet_argument_1);
                    436: 
                    437:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                    438:        return;
                    439:    }
                    440: 
                    441:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    442:            &s_objet_argument_3) == d_erreur)
                    443:    {
                    444:        liberation(s_etat_processus, s_objet_argument_1);
                    445:        liberation(s_etat_processus, s_objet_argument_2);
                    446: 
                    447:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                    448:        return;
                    449:    }
                    450: 
                    451:    if (((*s_objet_argument_1).type == CHN) &&
                    452:            ((*s_objet_argument_2).type == CHN) &&
                    453:            (((*s_objet_argument_3).type == INT) ||
                    454:            ((*s_objet_argument_3).type == REL)))
                    455:    {
1.5       bertrand  456:        if ((*s_etat_processus).rpl_home == NULL)
                    457:        {
                    458:            longueur_chaine = strlen(ds_rplconvert_commande) - 9
                    459:                    + strlen((unsigned char *) (*s_objet_argument_1).objet)
                    460:                    + strlen((unsigned char *) (*s_objet_argument_2).objet)
                    461:                    + (2 * strlen(d_exec_path));
1.1       bertrand  462: 
1.5       bertrand  463:            if ((commande = malloc((longueur_chaine + 1) *
                    464:                    sizeof(unsigned char))) == NULL)
                    465:            {
                    466:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    467:                return;
                    468:            }
                    469: 
                    470:            sprintf(commande, ds_rplconvert_commande, d_exec_path, d_exec_path,
                    471:                    (unsigned char *) (*s_objet_argument_2).objet,
                    472:                    (unsigned char *) (*s_objet_argument_1).objet);
1.6       bertrand  473: 
                    474:            if (alsprintf(&executable_candidat, "%s/bin/rplconvert",
                    475:                    d_exec_path) < 0)
                    476:            {
                    477:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    478:                return;
                    479:            }
                    480: 
                    481:            if (controle(s_etat_processus, executable_candidat, "md5",
                    482:                    rplconvert_md5) != d_vrai)
                    483:            {
                    484:                (*s_etat_processus).erreur_systeme = d_es_somme_controle;
                    485:                return;
                    486:            }
                    487: 
                    488:            if (controle(s_etat_processus, executable_candidat, "sha1",
                    489:                    rplconvert_sha1) != d_vrai)
                    490:            {
                    491:                (*s_etat_processus).erreur_systeme = d_es_somme_controle;
                    492:                return;
                    493:            }
                    494: 
                    495:            free(executable_candidat);
1.5       bertrand  496:        }
                    497:        else
1.1       bertrand  498:        {
1.5       bertrand  499:            longueur_chaine = strlen(ds_rplconvert_commande) - 9
                    500:                    + strlen((unsigned char *) (*s_objet_argument_1).objet)
                    501:                    + strlen((unsigned char *) (*s_objet_argument_2).objet)
                    502:                    + (2 * strlen((*s_etat_processus).rpl_home));
                    503: 
                    504:            if ((commande = malloc((longueur_chaine + 1) *
                    505:                    sizeof(unsigned char))) == NULL)
                    506:            {
                    507:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    508:                return;
                    509:            }
                    510: 
                    511:            sprintf(commande, ds_rplconvert_commande,
                    512:                    (*s_etat_processus).rpl_home, (*s_etat_processus).rpl_home,
                    513:                    (unsigned char *) (*s_objet_argument_2).objet,
                    514:                    (unsigned char *) (*s_objet_argument_1).objet);
1.6       bertrand  515: 
                    516:            if (alsprintf(&executable_candidat, "%s/bin/rplconvert",
                    517:                    (*s_etat_processus).rpl_home) < 0)
                    518:            {
                    519:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    520:                return;
                    521:            }
                    522: 
                    523:            if (controle(s_etat_processus, executable_candidat, "md5",
                    524:                    rplconvert_md5) != d_vrai)
                    525:            {
                    526:                (*s_etat_processus).erreur_systeme = d_es_somme_controle;
                    527:                return;
                    528:            }
                    529: 
                    530:            if (controle(s_etat_processus, executable_candidat, "sha1",
                    531:                    rplconvert_sha1) != d_vrai)
                    532:            {
                    533:                (*s_etat_processus).erreur_systeme = d_es_somme_controle;
                    534:                return;
                    535:            }
                    536: 
                    537:            free(executable_candidat);
1.1       bertrand  538:        }
                    539: 
                    540:        if ((pipe = popen(commande, "r")) == NULL)
                    541:        {
                    542:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                    543:            return;
                    544:        }
                    545: 
                    546:        free(commande);
                    547: 
                    548:        presence_resultat = d_faux;
                    549: 
                    550:        do
                    551:        {
                    552:            fin_fichier = fscanf(pipe, "%1024s", ligne);
                    553: 
                    554:            if (strcmp(ligne, "*") == 0)
                    555:            {
                    556:                fin_fichier = fscanf(pipe, "%1024s", ligne);
                    557: 
                    558:                if (fin_fichier != EOF)
                    559:                {
                    560:                    presence_resultat = d_vrai;
                    561: 
                    562:                    tampon_instruction =
                    563:                            (*s_etat_processus).instruction_courante;
                    564:                    (*s_etat_processus).instruction_courante = ligne;
                    565: 
                    566:                    recherche_type(s_etat_processus);
                    567:                    
                    568:                    (*s_etat_processus).instruction_courante =
                    569:                            tampon_instruction;
                    570: 
                    571:                    if ((*s_etat_processus).erreur_execution != d_ex)
                    572:                    {
                    573:                        if (pclose(pipe) == -1)
                    574:                        {
                    575:                            (*s_etat_processus).erreur_systeme = d_es_processus;
                    576:                            return;
                    577:                        }
                    578: 
                    579:                        liberation(s_etat_processus, s_objet_argument_1);
                    580:                        liberation(s_etat_processus, s_objet_argument_2);
                    581:                        liberation(s_etat_processus, s_objet_argument_3);
                    582: 
                    583:                        return;
                    584:                    }
                    585:                }
                    586:            }
                    587:        } while(fin_fichier != EOF);
                    588: 
                    589:        /*
                    590:         * Récupération de la ligne renvoyée commencant par "*". Si une telle
                    591:         * ligne n'existe par, rplconvert retourne une erreur de type
                    592:         * « conformability error » ou « Unknown unit ».
                    593:         */
                    594: 
                    595:        if (pclose(pipe) == -1)
                    596:        {
                    597:            (*s_etat_processus).erreur_systeme = d_es_processus;
                    598:            return;
                    599:        }
                    600: 
                    601:        if (presence_resultat == d_faux)
                    602:        {
                    603:            liberation(s_etat_processus, s_objet_argument_1);
                    604:            liberation(s_etat_processus, s_objet_argument_2);
                    605:            liberation(s_etat_processus, s_objet_argument_3);
                    606: 
                    607:            (*s_etat_processus).erreur_execution = d_ex_conversion_unite;
                    608:            return;
                    609:        }
                    610:        
                    611:        /*
                    612:         * Retrait des espaces dans la chaîne unité renvoyée
                    613:         */
                    614: 
                    615:        if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    616:                s_objet_argument_3) == d_erreur)
                    617:        {
                    618:            return;
                    619:        }
                    620: 
                    621:        if (last_valide == d_vrai)
                    622:        {
                    623:            cf(s_etat_processus, 31);
                    624:        }
                    625: 
                    626:        instruction_multiplication(s_etat_processus);
                    627: 
                    628:        if (last_valide == d_vrai)
                    629:        {
                    630:            sf(s_etat_processus, 31);
                    631:        }
                    632:    }
                    633:    else
                    634:    {
                    635:        liberation(s_etat_processus, s_objet_argument_1);
                    636:        liberation(s_etat_processus, s_objet_argument_2);
                    637:        liberation(s_etat_processus, s_objet_argument_3);
                    638: 
                    639:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
                    640:        return;
                    641:    }
                    642: 
                    643:    liberation(s_etat_processus, s_objet_argument_1);
                    644:    liberation(s_etat_processus, s_objet_argument_2);
                    645: 
                    646:    return;
                    647: }
                    648: 
                    649: 
                    650: /*
                    651: ================================================================================
                    652:   Fonction 'close'
                    653: ================================================================================
                    654:   Entrées :
                    655: --------------------------------------------------------------------------------
                    656:   Sorties :
                    657: --------------------------------------------------------------------------------
                    658:   Effets de bord : néant
                    659: ================================================================================
                    660: */
                    661: 
                    662: void
                    663: instruction_close(struct_processus *s_etat_processus)
                    664: {
1.7       bertrand  665:    const char                  *queue;
1.1       bertrand  666: 
                    667:    int                         socket;
                    668: 
                    669:    logical1                    socket_connectee;
                    670: 
1.7       bertrand  671:    sqlite3_stmt                *ppStmt;
                    672: 
                    673:    struct_descripteur_fichier  *descripteur;
                    674: 
1.1       bertrand  675:    struct_liste_chainee        *l_element_courant;
                    676:    struct_liste_chainee        *l_element_precedent;
                    677: 
                    678:    struct_objet                *s_objet_argument;
                    679: 
                    680:    (*s_etat_processus).erreur_execution = d_ex;
                    681: 
                    682:    if ((*s_etat_processus).affichage_arguments == 'Y')
                    683:    {
                    684:        printf("\n  CLOSE ");
                    685: 
                    686:        if ((*s_etat_processus).langue == 'F')
                    687:        {
                    688:            printf("(fermeture d'un fichier, d'une socket ou d'un sémaphore)"
                    689:                    "\n\n");
                    690:        }
                    691:        else
                    692:        {
                    693:            printf("(close file, socket or semaphore)\n\n");
                    694:        }
                    695: 
                    696:        printf("    1: %s\n\n", d_FCH);
                    697: 
                    698:        printf("    1: %s\n\n", d_SCK);
                    699: 
                    700:        printf("    1: %s\n", d_SPH);
                    701: 
                    702:        return;
                    703:    }
                    704:    else if ((*s_etat_processus).test_instruction == 'Y')
                    705:    {
                    706:        (*s_etat_processus).nombre_arguments = -1;
                    707:        return;
                    708:    }
                    709: 
                    710:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                    711:    {
                    712:        if (empilement_pile_last(s_etat_processus, 1) == d_erreur)
                    713:        {
                    714:            return;
                    715:        }
                    716:    }
                    717: 
                    718:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                    719:            &s_objet_argument) == d_erreur)
                    720:    {
                    721:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                    722:        return;
                    723:    }
                    724: 
                    725:    if ((*s_objet_argument).type == FCH)
                    726:    {
                    727:        /*
                    728:         * Retrait du descripteur de la pile de fichiers
                    729:         */
                    730: 
                    731:        l_element_courant = (*s_etat_processus).s_fichiers;
                    732:        l_element_precedent = NULL;
                    733: 
                    734:        descripteur = NULL;
                    735: 
                    736:        while(l_element_courant != NULL)
                    737:        {
                    738:            if (((*((struct_descripteur_fichier *) (*l_element_courant).donnee))
                    739:                    .identifiant == (*((struct_fichier *) (*s_objet_argument)
                    740:                    .objet)).descripteur) && ((*((struct_descripteur_fichier *)
                    741:                    (*l_element_courant).donnee)).pid == getpid()) &&
                    742:                    (pthread_equal((*((struct_descripteur_fichier *)
                    743:                    (*l_element_courant).donnee)).tid, pthread_self()) != 0))
                    744:            {
                    745:                if (((*((struct_fichier *) (*s_objet_argument).objet)).pid ==
                    746:                        (*((struct_descripteur_fichier *) (*l_element_courant)
                    747:                        .donnee)).pid) && (pthread_equal((*((struct_fichier *)
                    748:                        (*s_objet_argument).objet)).tid,
                    749:                        (*((struct_descripteur_fichier *) (*l_element_courant)
                    750:                        .donnee)).tid) != 0))
                    751:                {
1.7       bertrand  752:                    descripteur = (struct_descripteur_fichier *)
                    753:                            (*l_element_courant).donnee;
1.1       bertrand  754: 
                    755:                    if (l_element_precedent == NULL)
                    756:                    {
                    757:                        (*s_etat_processus).s_fichiers =
                    758:                                (*l_element_courant).suivant;
                    759:                    }
                    760:                    else if ((*l_element_courant).suivant == NULL)
                    761:                    {
                    762:                        (*l_element_precedent).suivant = NULL;
                    763:                    }
                    764:                    else
                    765:                    {
                    766:                        (*l_element_precedent).suivant =
                    767:                                (*l_element_courant).suivant;
                    768:                    }
                    769: 
                    770:                    free((*((struct_descripteur_fichier *)
                    771:                            (*l_element_courant).donnee)).nom);
                    772:                    free(l_element_courant);
                    773: 
                    774:                    break;
                    775:                }
                    776:            }
                    777: 
                    778:            l_element_precedent = l_element_courant;
                    779:            l_element_courant = (*l_element_courant).suivant;
                    780:        }
                    781: 
                    782:        if (descripteur == NULL)
                    783:        {
                    784:            liberation(s_etat_processus, s_objet_argument);
                    785: 
                    786:            (*s_etat_processus).erreur_execution = d_ex_erreur_acces_fichier;
                    787:            return;
                    788:        }
                    789: 
                    790:        /*
                    791:         * Fermeture du fichier
                    792:         */
                    793: 
1.7       bertrand  794:        if (fclose((*descripteur).descripteur_c) != 0)
1.1       bertrand  795:        {
1.7       bertrand  796:            free(descripteur);
1.1       bertrand  797:            liberation(s_etat_processus, s_objet_argument);
                    798: 
                    799:            (*s_etat_processus).erreur_systeme = d_es_erreur_fichier;
                    800:            return;
                    801:        }
                    802: 
1.7       bertrand  803:        if ((*descripteur).type != 'C')
                    804:        {
                    805:            if (sqlite3_prepare_v2((*descripteur).descripteur_sqlite,
                    806:                    "vacuum", 7, &ppStmt, &queue) != SQLITE_OK)
                    807:            {
                    808:                free(descripteur);
                    809:                liberation(s_etat_processus, s_objet_argument);
                    810: 
                    811:                (*s_etat_processus).erreur_systeme = d_es_erreur_fichier;
                    812:                return;
                    813:            }
                    814: 
                    815:            if (sqlite3_step(ppStmt) != SQLITE_DONE)
                    816:            {
                    817:                free(descripteur);
                    818:                liberation(s_etat_processus, s_objet_argument);
                    819: 
                    820:                (*s_etat_processus).erreur_systeme = d_es_erreur_fichier;
                    821:                return;
                    822:            }
                    823: 
                    824:            if (sqlite3_finalize(ppStmt) != SQLITE_OK)
                    825:            {
                    826:                free(descripteur);
                    827:                liberation(s_etat_processus, s_objet_argument);
                    828: 
                    829:                (*s_etat_processus).erreur_systeme = d_es_erreur_fichier;
                    830:                return;
                    831:            }
                    832: 
                    833:            if (sqlite3_close((*descripteur).descripteur_sqlite) != SQLITE_OK)
                    834:            {
                    835:                free(descripteur);
                    836:                liberation(s_etat_processus, s_objet_argument);
                    837: 
                    838:                (*s_etat_processus).erreur_systeme = d_es_erreur_fichier;
                    839:                return;
                    840:            }
                    841: 
                    842:            free(descripteur);
                    843:        }
                    844: 
1.1       bertrand  845:        if ((*((struct_fichier *) (*s_objet_argument).objet)).ouverture == 'S')
                    846:        {
                    847:            if (destruction_fichier((*((struct_fichier *)
                    848:                    (*s_objet_argument).objet)).nom) == d_erreur)
                    849:            {
                    850:                liberation(s_etat_processus, s_objet_argument);
                    851: 
                    852:                (*s_etat_processus).erreur_systeme = d_es_erreur_fichier;
                    853:                return;
                    854:            }
                    855:        }
                    856:    }
                    857:    else if ((*s_objet_argument).type == SCK)
                    858:    {
                    859:        /*
                    860:         * Retrait de la socket de la pile
                    861:         */
                    862: 
                    863:        l_element_courant = (*s_etat_processus).s_sockets;
                    864:        l_element_precedent = NULL;
                    865: 
                    866:        socket = -1;
                    867:        socket_connectee = d_faux;
                    868: 
                    869:        while(l_element_courant != NULL)
                    870:        {
                    871:            if ((*((struct_socket *) (*(*l_element_courant).donnee).objet))
                    872:                    .socket == (*((struct_socket *) (*s_objet_argument)
                    873:                    .objet)).socket)
                    874:            {
                    875:                socket = (*((struct_socket *)
                    876:                        (*(*l_element_courant).donnee).objet)).socket;
                    877:                socket_connectee = (*((struct_socket *)
                    878:                        (*(*l_element_courant).donnee).objet)).socket_connectee;
                    879: 
                    880:                if (l_element_precedent == NULL)
                    881:                {
                    882:                    (*s_etat_processus).s_sockets =
                    883:                            (*l_element_courant).suivant;
                    884:                }
                    885:                else if ((*l_element_courant).suivant == NULL)
                    886:                {
                    887:                    (*l_element_precedent).suivant = NULL;
                    888:                }
                    889:                else
                    890:                {
                    891:                    (*l_element_precedent).suivant =
                    892:                            (*l_element_courant).suivant;
                    893:                }
                    894: 
                    895:                liberation(s_etat_processus, (*l_element_courant).donnee);
                    896:                free(l_element_courant);
                    897: 
                    898:                break;
                    899:            }
                    900: 
                    901:            l_element_precedent = l_element_courant;
                    902:            l_element_courant = (*l_element_courant).suivant;
                    903:        }
                    904: 
                    905:        if (socket == -1)
                    906:        {
                    907:            liberation(s_etat_processus, s_objet_argument);
                    908: 
                    909:            (*s_etat_processus).erreur_execution = d_ex_erreur_acces_fichier;
                    910:            return;
                    911:        }
                    912: 
                    913:        /*
                    914:         * Fermeture de la socket
                    915:         */
                    916: 
                    917:        if (socket_connectee == d_vrai)
                    918:        {
                    919:            shutdown(socket, SHUT_RDWR);
                    920:        }
                    921: 
                    922:        if (close(socket) != 0)
                    923:        {
                    924:            liberation(s_etat_processus, s_objet_argument);
                    925: 
                    926:            (*s_etat_processus).erreur_systeme = d_es_erreur_fichier;
                    927:            return;
                    928:        }
                    929: 
                    930:        if ((*((struct_socket *) (*s_objet_argument).objet)).effacement == 'Y')
                    931:        {
                    932:            unlink((*((struct_socket *) (*s_objet_argument).objet)).adresse);
                    933:        }
                    934:    }
                    935:    else if ((*s_objet_argument).type == SPH)
                    936:    {
                    937:        if (sem_close((*((struct_semaphore *) (*s_objet_argument).objet))
                    938:                .semaphore) != 0)
                    939:        {
                    940:            (*s_etat_processus).erreur_execution = d_ex_semaphore;
                    941:            return;
                    942:        }
                    943:    }
                    944:    else
                    945:    {
                    946:        liberation(s_etat_processus, s_objet_argument);
                    947: 
                    948:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
                    949:        return;
                    950:    }
                    951: 
                    952:    liberation(s_etat_processus, s_objet_argument);
                    953: 
                    954:    return;
                    955: }
                    956: 
                    957: 
                    958: /*
                    959: ================================================================================
                    960:   Fonction 'create'
                    961: ================================================================================
                    962:   Entrées :
                    963: --------------------------------------------------------------------------------
                    964:   Sorties :
                    965: --------------------------------------------------------------------------------
                    966:   Effets de bord : néant
                    967: ================================================================================
                    968: */
                    969: 
                    970: void
                    971: instruction_create(struct_processus *s_etat_processus)
                    972: {
                    973:    file                        *fichier;
                    974: 
                    975:    logical1                    erreur;
                    976:    logical1                    existence;
                    977:    logical1                    ouverture;
                    978: 
                    979:    struct_objet                *s_objet_argument;
                    980: 
1.7       bertrand  981:    unsigned char               *nom;
                    982: 
1.1       bertrand  983:    unsigned long               unite;
                    984: 
                    985:    (*s_etat_processus).erreur_execution = d_ex;
                    986: 
                    987:    if ((*s_etat_processus).affichage_arguments == 'Y')
                    988:    {
                    989:        printf("\n  CREATE ");
                    990: 
                    991:        if ((*s_etat_processus).langue == 'F')
                    992:        {
                    993:            printf("(création d'un fichier)\n\n");
                    994:        }
                    995:        else
                    996:        {
                    997:            printf("(create file)\n\n");
                    998:        }
                    999: 
                   1000:        printf("    1: %s\n", d_CHN);
                   1001: 
                   1002:        return;
                   1003:    }
                   1004:    else if ((*s_etat_processus).test_instruction == 'Y')
                   1005:    {
                   1006:        (*s_etat_processus).nombre_arguments = -1;
                   1007:        return;
                   1008:    }
                   1009: 
                   1010:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                   1011:    {
                   1012:        if (empilement_pile_last(s_etat_processus, 1) == d_erreur)
                   1013:        {
                   1014:            return;
                   1015:        }
                   1016:    }
                   1017: 
                   1018:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                   1019:            &s_objet_argument) == d_erreur)
                   1020:    {
                   1021:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                   1022:        return;
                   1023:    }
                   1024: 
                   1025:    if ((*s_objet_argument).type == CHN)
                   1026:    {
1.7       bertrand 1027:        if ((nom = transliteration(s_etat_processus, (unsigned char *)
                   1028:                (*s_objet_argument).objet, d_locale, "UTF-8")) == NULL)
                   1029:        {
                   1030:            liberation(s_etat_processus, s_objet_argument);
                   1031:            return;
                   1032:        }
                   1033: 
                   1034:        erreur = caracteristiques_fichier(s_etat_processus, nom,
                   1035:                &existence, &ouverture, &unite);
1.1       bertrand 1036: 
                   1037:        if ((erreur != d_absence_erreur) || (existence == d_vrai))
                   1038:        {
                   1039:            liberation(s_etat_processus, s_objet_argument);
1.7       bertrand 1040:            free(nom);
1.1       bertrand 1041: 
                   1042:            (*s_etat_processus).erreur_execution =
                   1043:                    d_ex_erreur_acces_fichier;
                   1044:            return;
                   1045:        }
                   1046: 
1.7       bertrand 1047:        if ((fichier = fopen(nom, "w")) == NULL)
1.1       bertrand 1048:        {
                   1049:            liberation(s_etat_processus, s_objet_argument);
1.7       bertrand 1050:            free(nom);
1.1       bertrand 1051: 
                   1052:            (*s_etat_processus).erreur_execution =
                   1053:                    d_ex_erreur_acces_fichier;
                   1054:            return;
                   1055:        }
                   1056: 
1.7       bertrand 1057:        free(nom);
                   1058: 
1.1       bertrand 1059:        if (fclose(fichier) != 0)
                   1060:        {
                   1061:            liberation(s_etat_processus, s_objet_argument);
                   1062: 
                   1063:            (*s_etat_processus).erreur_execution =
                   1064:                    d_ex_erreur_acces_fichier;
                   1065:            return;
                   1066:        }
                   1067:    }
                   1068:    else
                   1069:    {
                   1070:        liberation(s_etat_processus, s_objet_argument);
                   1071: 
                   1072:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
                   1073:        return;
                   1074:    }
                   1075: 
                   1076:    liberation(s_etat_processus, s_objet_argument);
                   1077: 
                   1078:    return;
                   1079: }
                   1080: 
                   1081: 
                   1082: /*
                   1083: ================================================================================
                   1084:   Fonction 'cswp'
                   1085: ================================================================================
                   1086:   Entrées :
                   1087: --------------------------------------------------------------------------------
                   1088:   Sorties :
                   1089: --------------------------------------------------------------------------------
                   1090:   Effets de bord : néant
                   1091: ================================================================================
                   1092: */
                   1093: 
                   1094: void
                   1095: instruction_cswp(struct_processus *s_etat_processus)
                   1096: {
                   1097:    struct_objet                *s_copie_argument_3;
                   1098:    struct_objet                *s_objet_argument_1;
                   1099:    struct_objet                *s_objet_argument_2;
                   1100:    struct_objet                *s_objet_argument_3;
                   1101: 
                   1102:    signed long                 colonne_1;
                   1103:    signed long                 colonne_2;
                   1104: 
                   1105:    unsigned long               i;
                   1106: 
                   1107:    (*s_etat_processus).erreur_execution = d_ex;
                   1108: 
                   1109:    if ((*s_etat_processus).affichage_arguments == 'Y')
                   1110:    {
                   1111:        printf("\n  CSWP ");
                   1112: 
                   1113:        if ((*s_etat_processus).langue == 'F')
                   1114:        {
                   1115:            printf("(échange de deux colonnes d'une matrice)\n\n");
                   1116:        }
                   1117:        else
                   1118:        {
                   1119:            printf("(swap two columns of a matrix)\n\n");
                   1120:        }
                   1121: 
                   1122:        printf("    3: %s, %s, %s\n", d_MIN, d_MRL, d_MCX);
                   1123:        printf("    2: %s\n", d_INT);
                   1124:        printf("    1: %s\n", d_INT);
                   1125:        printf("->  1: %s, %s, %s\n", d_MIN, d_MRL, d_MCX);
                   1126: 
                   1127:        return;
                   1128:    }
                   1129:    else if ((*s_etat_processus).test_instruction == 'Y')
                   1130:    {
                   1131:        (*s_etat_processus).nombre_arguments = -1;
                   1132:        return;
                   1133:    }
                   1134: 
                   1135:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
                   1136:    {
                   1137:        if (empilement_pile_last(s_etat_processus, 3) == d_erreur)
                   1138:        {
                   1139:            return;
                   1140:        }
                   1141:    }
                   1142: 
                   1143:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                   1144:            &s_objet_argument_1) == d_erreur)
                   1145:    {
                   1146:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                   1147:        return;
                   1148:    }
                   1149: 
                   1150:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                   1151:            &s_objet_argument_2) == d_erreur)
                   1152:    {
                   1153:        liberation(s_etat_processus, s_objet_argument_1);
                   1154: 
                   1155:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                   1156:        return;
                   1157:    }
                   1158: 
                   1159:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                   1160:            &s_objet_argument_3) == d_erreur)
                   1161:    {
                   1162:        liberation(s_etat_processus, s_objet_argument_1);
                   1163:        liberation(s_etat_processus, s_objet_argument_2);
                   1164: 
                   1165:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
                   1166:        return;
                   1167:    }
                   1168: 
                   1169:    if (((*s_objet_argument_1).type == INT) &&
                   1170:            ((*s_objet_argument_2).type == INT))
                   1171:    {
                   1172:        colonne_1 = (*((integer8 *) (*s_objet_argument_1).objet)) - 1;
                   1173:        colonne_2 = (*((integer8 *) (*s_objet_argument_2).objet)) - 1;
                   1174: 
                   1175:        if ((*s_objet_argument_3).type == MIN)
                   1176:        {
                   1177:            if ((colonne_1 < 0) || (colonne_1 > ((signed long)
                   1178:                    (*((struct_matrice *) (*s_objet_argument_3).objet))
                   1179:                    .nombre_colonnes) - 1) || (colonne_2 < 0) || (colonne_2 >
                   1180:                    ((signed long) (*((struct_matrice *)
                   1181:                    (*s_objet_argument_3).objet)).nombre_colonnes) - 1))
                   1182:            {
                   1183:                liberation(s_etat_processus, s_objet_argument_1);
                   1184:                liberation(s_etat_processus, s_objet_argument_2);
                   1185:                liberation(s_etat_processus, s_objet_argument_3);
                   1186: 
                   1187:                (*s_etat_processus).erreur_execution =
                   1188:                        d_ex_dimensions_invalides;
                   1189:                return;
                   1190:            }
                   1191: 
                   1192:            if ((s_copie_argument_3 = copie_objet(s_etat_processus,
                   1193:                    s_objet_argument_3, 'Q')) == NULL)
                   1194:            {
                   1195:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                   1196:                return;
                   1197:            }
                   1198: 
                   1199:            for(i = 0; i < (*((struct_matrice *) (*s_objet_argument_3).objet))
                   1200:                    .nombre_lignes; i++)
                   1201:            {
                   1202:                ((integer8 **) (*((struct_matrice *)
                   1203:                        (*s_copie_argument_3).objet)).tableau)
                   1204:                        [i][colonne_1] = ((integer8 **) (*((struct_matrice *)
                   1205:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_2];
                   1206:                ((integer8 **) (*((struct_matrice *)
                   1207:                        (*s_copie_argument_3).objet)).tableau)
                   1208:                        [i][colonne_2] = ((integer8 **) (*((struct_matrice *)
                   1209:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_1];
                   1210:            }
                   1211:        }
                   1212:        else if ((*s_objet_argument_3).type == MRL)
                   1213:        {
                   1214:            if ((colonne_1 < 0) || (colonne_1 > ((signed long)
                   1215:                    (*((struct_matrice *) (*s_objet_argument_3).objet))
                   1216:                    .nombre_colonnes) - 1) || (colonne_2 < 0) || (colonne_2 >
                   1217:                    ((signed long) (*((struct_matrice *)
                   1218:                    (*s_objet_argument_3).objet)).nombre_colonnes) - 1))
                   1219:            {
                   1220:                liberation(s_etat_processus, s_objet_argument_1);
                   1221:                liberation(s_etat_processus, s_objet_argument_2);
                   1222:                liberation(s_etat_processus, s_objet_argument_3);
                   1223: 
                   1224:                (*s_etat_processus).erreur_execution =
                   1225:                        d_ex_dimensions_invalides;
                   1226:                return;
                   1227:            }
                   1228: 
                   1229:            if ((s_copie_argument_3 = copie_objet(s_etat_processus,
                   1230:                    s_objet_argument_3, 'O')) == NULL)
                   1231:            {
                   1232:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                   1233:                return;
                   1234:            }
                   1235: 
                   1236:            for(i = 0; i < (*((struct_matrice *) (*s_objet_argument_3).objet))
                   1237:                    .nombre_lignes; i++)
                   1238:            {
                   1239:                ((real8 **) (*((struct_matrice *)
                   1240:                        (*s_copie_argument_3).objet)).tableau)
                   1241:                        [i][colonne_1] = ((real8 **) (*((struct_matrice *)
                   1242:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_2];
                   1243:                ((real8 **) (*((struct_matrice *)
                   1244:                        (*s_copie_argument_3).objet)).tableau)
                   1245:                        [i][colonne_2] = ((real8 **) (*((struct_matrice *)
                   1246:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_1];
                   1247:            }
                   1248:        }
                   1249:        else if ((*s_objet_argument_3).type == MCX)
                   1250:        {
                   1251:            if ((colonne_1 < 0) || (colonne_1 > ((signed long)
                   1252:                    (*((struct_matrice *) (*s_objet_argument_3).objet))
                   1253:                    .nombre_colonnes) - 1) || (colonne_2 < 0) || (colonne_2 >
                   1254:                    ((signed long) (*((struct_matrice *)
                   1255:                    (*s_objet_argument_3).objet)).nombre_colonnes) - 1))
                   1256:            {
                   1257:                liberation(s_etat_processus, s_objet_argument_1);
                   1258:                liberation(s_etat_processus, s_objet_argument_2);
                   1259:                liberation(s_etat_processus, s_objet_argument_3);
                   1260: 
                   1261:                (*s_etat_processus).erreur_execution =
                   1262:                        d_ex_dimensions_invalides;
                   1263:                return;
                   1264:            }
                   1265: 
                   1266:            if ((s_copie_argument_3 = copie_objet(s_etat_processus,
                   1267:                    s_objet_argument_3, 'O')) == NULL)
                   1268:            {
                   1269:                (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
                   1270:                return;
                   1271:            }
                   1272: 
                   1273:            for(i = 0; i < (*((struct_matrice *) (*s_objet_argument_3).objet))
                   1274:                    .nombre_lignes; i++)
                   1275:            {
                   1276:                ((complex16 **) (*((struct_matrice *)
                   1277:                        (*s_copie_argument_3).objet)).tableau)
                   1278:                        [i][colonne_1].partie_reelle =
                   1279:                        ((complex16 **) (*((struct_matrice *)
                   1280:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_2]
                   1281:                        .partie_reelle;
                   1282:                ((complex16 **) (*((struct_matrice *)
                   1283:                        (*s_copie_argument_3).objet)).tableau)
                   1284:                        [i][colonne_1].partie_imaginaire =
                   1285:                        ((complex16 **) (*((struct_matrice *)
                   1286:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_2]
                   1287:                        .partie_imaginaire;
                   1288:                ((complex16 **) (*((struct_matrice *)
                   1289:                        (*s_copie_argument_3).objet)).tableau)
                   1290:                        [i][colonne_2].partie_reelle =
                   1291:                        ((complex16 **) (*((struct_matrice *)
                   1292:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_1]
                   1293:                        .partie_reelle;
                   1294:                ((complex16 **) (*((struct_matrice *)
                   1295:                        (*s_copie_argument_3).objet)).tableau)
                   1296:                        [i][colonne_2].partie_imaginaire =
                   1297:                        ((complex16 **) (*((struct_matrice *)
                   1298:                        (*s_objet_argument_3).objet)).tableau)[i][colonne_1]
                   1299:                        .partie_imaginaire;
                   1300:            }
                   1301:        }
                   1302:        else
                   1303:        {
                   1304:            liberation(s_etat_processus, s_objet_argument_1);
                   1305:            liberation(s_etat_processus, s_objet_argument_2);
                   1306:            liberation(s_etat_processus, s_objet_argument_3);
                   1307: 
                   1308:            (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
                   1309:            return;
                   1310:        }
                   1311:    }
                   1312:    else
                   1313:    {
                   1314:        liberation(s_etat_processus, s_objet_argument_1);
                   1315:        liberation(s_etat_processus, s_objet_argument_2);
                   1316:        liberation(s_etat_processus, s_objet_argument_3);
                   1317: 
                   1318:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
                   1319:        return;
                   1320:    }
                   1321: 
                   1322:    liberation(s_etat_processus, s_objet_argument_1);
                   1323:    liberation(s_etat_processus, s_objet_argument_2);
                   1324:    liberation(s_etat_processus, s_objet_argument_3);
                   1325: 
                   1326:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
                   1327:            s_copie_argument_3) == d_erreur)
                   1328:    {
                   1329:        return;
                   1330:    }
                   1331: 
                   1332:    return;
                   1333: }
                   1334: 
                   1335: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>