Annotation of rpl/src/instructions_c7.c, revision 1.1

1.1     ! bertrand    1: /*
        !             2: ================================================================================
        !             3:   RPL/2 (R) version 4.0.9
        !             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: #include "rpl.conv.h"
        !            24: 
        !            25: 
        !            26: /*
        !            27: ================================================================================
        !            28:   Fonction 'crmtx'
        !            29: ================================================================================
        !            30:   Entrées :
        !            31: --------------------------------------------------------------------------------
        !            32:   Sorties :
        !            33: --------------------------------------------------------------------------------
        !            34:   Effets de bord : néant
        !            35: ================================================================================
        !            36: */
        !            37: 
        !            38: void
        !            39: instruction_crmtx(struct_processus *s_etat_processus)
        !            40: {
        !            41:    pthread_mutexattr_t             attributs_mutex;
        !            42: 
        !            43:    struct_liste_chainee            *s_mutex;
        !            44: 
        !            45:    struct_objet                    *s_objet;
        !            46: 
        !            47:    (*s_etat_processus).erreur_execution = d_ex;
        !            48: 
        !            49:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !            50:    {
        !            51:        printf("\n  CRMTX ");
        !            52: 
        !            53:        if ((*s_etat_processus).langue == 'F')
        !            54:        {
        !            55:            printf("(création d'un mutex)\n\n");
        !            56:            printf("  Aucun argument\n");
        !            57:        }
        !            58:        else
        !            59:        {
        !            60:            printf("(create mutex)\n\n");
        !            61:            printf("  No argument\n");
        !            62:        }
        !            63: 
        !            64:        return;
        !            65:    }
        !            66:    else if ((*s_etat_processus).test_instruction == 'Y')
        !            67:    {
        !            68:        (*s_etat_processus).nombre_arguments = -1;
        !            69:        return;
        !            70:    }
        !            71: 
        !            72:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !            73:    {
        !            74:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
        !            75:        {
        !            76:            return;
        !            77:        }
        !            78:    }
        !            79: 
        !            80:    if ((s_mutex = allocation_maillon(s_etat_processus)) == NULL)
        !            81:    {
        !            82:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !            83:        return;
        !            84:    }
        !            85: 
        !            86:    if ((s_objet = allocation(s_etat_processus, MTX)) == NULL)
        !            87:    {
        !            88:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !            89:        return;
        !            90:    }
        !            91: 
        !            92:    pthread_mutexattr_init(&attributs_mutex);
        !            93:    pthread_mutexattr_settype(&attributs_mutex, PTHREAD_MUTEX_NORMAL);
        !            94:    pthread_mutex_init(&((*((struct_mutex *) (*s_objet).objet)).mutex),
        !            95:            &attributs_mutex);
        !            96:    pthread_mutexattr_destroy(&attributs_mutex);
        !            97: 
        !            98:    if (((*s_mutex).donnee = copie_objet(s_etat_processus, s_objet, 'P'))
        !            99:            == NULL)
        !           100:    {
        !           101:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !           102:        return;
        !           103:    }
        !           104: 
        !           105:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           106:            s_objet) == d_erreur)
        !           107:    {
        !           108:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !           109:        return;
        !           110:    }
        !           111: 
        !           112:    if (pthread_mutex_lock(&((*s_etat_processus).protection_liste_mutexes))
        !           113:            != 0)
        !           114:    {
        !           115:        (*s_etat_processus).erreur_systeme = d_es_processus;
        !           116:        return;
        !           117:    }
        !           118: 
        !           119:    (*s_mutex).suivant = (*s_etat_processus).liste_mutexes;
        !           120:    (*s_etat_processus).liste_mutexes = s_mutex;
        !           121: 
        !           122:    if (pthread_mutex_unlock(&((*s_etat_processus).protection_liste_mutexes))
        !           123:            != 0)
        !           124:    {
        !           125:        (*s_etat_processus).erreur_systeme = d_es_processus;
        !           126:        return;
        !           127:    }
        !           128: 
        !           129:    return;
        !           130: }
        !           131: 
        !           132: 
        !           133: /*
        !           134: ================================================================================
        !           135:   Fonction 'clrmtx'
        !           136: ================================================================================
        !           137:   Entrées :
        !           138: --------------------------------------------------------------------------------
        !           139:   Sorties :
        !           140: --------------------------------------------------------------------------------
        !           141:   Effets de bord : néant
        !           142: ================================================================================
        !           143: */
        !           144: 
        !           145: void
        !           146: instruction_clrmtx(struct_processus *s_etat_processus)
        !           147: {
        !           148:    struct_liste_chainee        *l_element_courant;
        !           149:    struct_liste_chainee        *l_element_precedent;
        !           150: 
        !           151:    struct_objet                *s_objet;
        !           152: 
        !           153:    (*s_etat_processus).erreur_execution = d_ex;
        !           154: 
        !           155:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !           156:    {
        !           157:        printf("\n  CLRMTX ");
        !           158: 
        !           159:        if ((*s_etat_processus).langue == 'F')
        !           160:        {
        !           161:            printf("(destruction d'un mutex)\n\n");
        !           162:        }
        !           163:        else
        !           164:        {
        !           165:            printf("(clear mutex)\n\n");
        !           166:        }
        !           167: 
        !           168:        printf("    1: %s\n", d_MTX);
        !           169: 
        !           170:        return;
        !           171:    }
        !           172:    else if ((*s_etat_processus).test_instruction == 'Y')
        !           173:    {
        !           174:        (*s_etat_processus).nombre_arguments = -1;
        !           175:        return;
        !           176:    }
        !           177: 
        !           178:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !           179:    {
        !           180:        if (empilement_pile_last(s_etat_processus, 1) == d_erreur)
        !           181:        {
        !           182:            return;
        !           183:        }
        !           184:    }
        !           185: 
        !           186:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           187:            &s_objet) == d_erreur)
        !           188:    {
        !           189:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
        !           190:        return;
        !           191:    }
        !           192: 
        !           193:    if ((*s_objet).type == MTX)
        !           194:    {
        !           195:        l_element_precedent = NULL;
        !           196:        l_element_courant = (*s_etat_processus).liste_mutexes;
        !           197: 
        !           198:        while(l_element_courant != NULL)
        !           199:        {
        !           200:            if (&((*((struct_mutex *) (*s_objet).objet)).mutex) ==
        !           201:                    &((*((struct_mutex *) (*(*l_element_courant).donnee).objet))
        !           202:                    .mutex))
        !           203:            {
        !           204:                if (l_element_precedent == NULL)
        !           205:                {
        !           206:                    (*s_etat_processus).liste_mutexes =
        !           207:                            (*l_element_courant).suivant;
        !           208:                }
        !           209:                else if ((*l_element_courant).suivant == NULL)
        !           210:                {
        !           211:                    (*l_element_precedent).suivant = NULL;
        !           212:                }
        !           213:                else
        !           214:                {
        !           215:                    (*l_element_precedent).suivant =
        !           216:                            (*l_element_courant).suivant;
        !           217:                }
        !           218: 
        !           219:                liberation(s_etat_processus, (*l_element_courant).donnee);
        !           220:                free(l_element_courant);
        !           221: 
        !           222:                break;
        !           223:            }
        !           224: 
        !           225:            l_element_precedent = l_element_courant;
        !           226:            l_element_courant = (*l_element_courant).suivant;
        !           227:        }
        !           228: 
        !           229:        if (l_element_courant == NULL)
        !           230:        {
        !           231:            liberation(s_etat_processus, s_objet);
        !           232: 
        !           233:            (*s_etat_processus).erreur_execution = d_ex_mutex;
        !           234:            return;
        !           235:        }
        !           236:    }
        !           237:    else
        !           238:    {
        !           239:        liberation(s_etat_processus, s_objet);
        !           240: 
        !           241:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
        !           242:        return;
        !           243:    }
        !           244: 
        !           245:    liberation(s_etat_processus, s_objet);
        !           246: 
        !           247:    return;
        !           248: }
        !           249: 
        !           250: 
        !           251: /*
        !           252: ================================================================================
        !           253:   Fonction 'copy'
        !           254: ================================================================================
        !           255:   Entrées : structure processus
        !           256: --------------------------------------------------------------------------------
        !           257:   Sorties :
        !           258: --------------------------------------------------------------------------------
        !           259:   Effets de bord : néant
        !           260: ================================================================================
        !           261: */
        !           262: 
        !           263: void
        !           264: instruction_copy(struct_processus *s_etat_processus)
        !           265: {
        !           266:    struct_objet                    *s_objet_argument;
        !           267:    struct_objet                    *s_objet_resultat;
        !           268: 
        !           269:    (*s_etat_processus).erreur_execution = d_ex;
        !           270: 
        !           271:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !           272:    {
        !           273:        printf("\n  COPY ");
        !           274: 
        !           275:        if ((*s_etat_processus).langue == 'F')
        !           276:        {
        !           277:            printf("(création d'une nouvelle instance d'un objet)\n\n");
        !           278:        }
        !           279:        else
        !           280:        {
        !           281:            printf("(create new object instance)\n\n");
        !           282:        }
        !           283: 
        !           284:        printf("    1: %s, %s, %s, %s, %s, %s,\n"
        !           285:                "       %s, %s, %s, %s, %s,\n"
        !           286:                "       %s, %s, %s, %s, %s,\n"
        !           287:                "       %s, %s, %s, %s,\n"
        !           288:                "       %s, %s\n",
        !           289:                d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX,
        !           290:                d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK,
        !           291:                d_SQL, d_SLB, d_PRC, d_MTX);
        !           292:        printf("->  1: %s, %s, %s, %s, %s, %s,\n"
        !           293:                "       %s, %s, %s, %s, %s,\n"
        !           294:                "       %s, %s, %s, %s, %s,\n"
        !           295:                "       %s, %s, %s, %s,\n"
        !           296:                "       %s, %s\n",
        !           297:                d_INT, d_REL, d_CPL, d_VIN, d_VRL, d_VCX, d_MIN, d_MRL, d_MCX,
        !           298:                d_TAB, d_BIN, d_NOM, d_CHN, d_LST, d_ALG, d_RPN, d_FCH, d_SCK,
        !           299:                d_SQL, d_SLB, d_PRC, d_MTX);
        !           300: 
        !           301:        return;
        !           302:    }
        !           303:    else if ((*s_etat_processus).test_instruction == 'Y')
        !           304:    {
        !           305:        (*s_etat_processus).nombre_arguments = -1;
        !           306:        return;
        !           307:    }
        !           308: 
        !           309:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !           310:    {
        !           311:        if (empilement_pile_last(s_etat_processus, 1) == d_erreur)
        !           312:        {
        !           313:            return;
        !           314:        }
        !           315:    }
        !           316: 
        !           317:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           318:            &s_objet_argument) == d_erreur)
        !           319:    {
        !           320:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
        !           321:        return;
        !           322:    }
        !           323: 
        !           324:    s_objet_resultat = copie_objet(s_etat_processus, s_objet_argument, 'O');
        !           325:    liberation(s_etat_processus, s_objet_argument);
        !           326: 
        !           327:    if (s_objet_resultat == NULL)
        !           328:    {
        !           329:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !           330:        return;
        !           331:    }
        !           332: 
        !           333:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           334:            s_objet_resultat) == d_erreur)
        !           335:    {
        !           336:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !           337:        return;
        !           338:    }
        !           339: 
        !           340:    return;
        !           341: }
        !           342: 
        !           343: 
        !           344: /*
        !           345: ================================================================================
        !           346:   Fonction 'crsmphr'
        !           347: ================================================================================
        !           348:   Entrées :
        !           349: --------------------------------------------------------------------------------
        !           350:   Sorties :
        !           351: --------------------------------------------------------------------------------
        !           352:   Effets de bord : néant
        !           353: ================================================================================
        !           354: */
        !           355: 
        !           356: void
        !           357: instruction_crsmphr(struct_processus *s_etat_processus)
        !           358: {
        !           359:    sem_t                           *semaphore;
        !           360: 
        !           361:    struct_objet                    *s_objet_argument_1;
        !           362:    struct_objet                    *s_objet_argument_2;
        !           363: 
        !           364:    (*s_etat_processus).erreur_execution = d_ex;
        !           365: 
        !           366:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !           367:    {
        !           368:        printf("\n  CRSMPHR ");
        !           369: 
        !           370:        if ((*s_etat_processus).langue == 'F')
        !           371:        {
        !           372:            printf("(création d'un sémaphore nommé)\n\n");
        !           373:        }
        !           374:        else
        !           375:        {
        !           376:            printf("(create named semaphore)\n\n");
        !           377:        }
        !           378: 
        !           379:        printf("    2: %s\n", d_INT);
        !           380:        printf("    1: %s\n", d_CHN);
        !           381:        return;
        !           382:    }
        !           383:    else if ((*s_etat_processus).test_instruction == 'Y')
        !           384:    {
        !           385:        (*s_etat_processus).nombre_arguments = -1;
        !           386:        return;
        !           387:    }
        !           388: 
        !           389:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !           390:    {
        !           391:        if (empilement_pile_last(s_etat_processus, 2) == d_erreur)
        !           392:        {
        !           393:            return;
        !           394:        }
        !           395:    }
        !           396: 
        !           397:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           398:            &s_objet_argument_1) == d_erreur)
        !           399:    {
        !           400:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
        !           401:        return;
        !           402:    }
        !           403: 
        !           404:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           405:            &s_objet_argument_2) == d_erreur)
        !           406:    {
        !           407:        liberation(s_etat_processus, s_objet_argument_1);
        !           408: 
        !           409:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
        !           410:        return;
        !           411:    }
        !           412: 
        !           413:    if (((*s_objet_argument_1).type == CHN) &&
        !           414:            ((*s_objet_argument_2).type == INT))
        !           415:    {
        !           416:        if ((semaphore = sem_open((unsigned char *) (*s_objet_argument_1).objet,
        !           417:                O_CREAT | O_EXCL, S_IRUSR | S_IWUSR,
        !           418:                (int) (*((integer8 *) (*s_objet_argument_2).objet)))) ==
        !           419:                SEM_FAILED)
        !           420:        {
        !           421:            (*s_etat_processus).erreur_execution = d_ex_semaphore;
        !           422: 
        !           423:            liberation(s_etat_processus, s_objet_argument_1);
        !           424:            liberation(s_etat_processus, s_objet_argument_2);
        !           425: 
        !           426:            return;
        !           427:        }
        !           428: 
        !           429:        if (sem_close(semaphore) != 0)
        !           430:        {
        !           431:            (*s_etat_processus).erreur_execution = d_ex_semaphore;
        !           432: 
        !           433:            liberation(s_etat_processus, s_objet_argument_1);
        !           434:            liberation(s_etat_processus, s_objet_argument_2);
        !           435: 
        !           436:            return;
        !           437:        }
        !           438:    }
        !           439:    else
        !           440:    {
        !           441:        liberation(s_etat_processus, s_objet_argument_1);
        !           442:        liberation(s_etat_processus, s_objet_argument_2);
        !           443: 
        !           444:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
        !           445:        return;
        !           446:    }
        !           447: 
        !           448:    liberation(s_etat_processus, s_objet_argument_1);
        !           449:    liberation(s_etat_processus, s_objet_argument_2);
        !           450: 
        !           451:    return;
        !           452: }
        !           453: 
        !           454: 
        !           455: /*
        !           456: ================================================================================
        !           457:   Fonction 'clrsmphr'
        !           458: ================================================================================
        !           459:   Entrées :
        !           460: --------------------------------------------------------------------------------
        !           461:   Sorties :
        !           462: --------------------------------------------------------------------------------
        !           463:   Effets de bord : néant
        !           464: ================================================================================
        !           465: */
        !           466: 
        !           467: void
        !           468: instruction_clrsmphr(struct_processus *s_etat_processus)
        !           469: {
        !           470:    struct_objet                    *s_objet_argument;
        !           471: 
        !           472:    (*s_etat_processus).erreur_execution = d_ex;
        !           473: 
        !           474:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !           475:    {
        !           476:        printf("\n  CLRSMPHR ");
        !           477: 
        !           478:        if ((*s_etat_processus).langue == 'F')
        !           479:        {
        !           480:            printf("(destruction d'un sémaphore nommé)\n\n");
        !           481:        }
        !           482:        else
        !           483:        {
        !           484:            printf("(delete named semaphore)\n\n");
        !           485:        }
        !           486: 
        !           487:        printf("    1: %s\n", d_CHN);
        !           488:        return;
        !           489:    }
        !           490:    else if ((*s_etat_processus).test_instruction == 'Y')
        !           491:    {
        !           492:        (*s_etat_processus).nombre_arguments = -1;
        !           493:        return;
        !           494:    }
        !           495: 
        !           496:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !           497:    {
        !           498:        if (empilement_pile_last(s_etat_processus, 1) == d_erreur)
        !           499:        {
        !           500:            return;
        !           501:        }
        !           502:    }
        !           503: 
        !           504:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           505:            &s_objet_argument) == d_erreur)
        !           506:    {
        !           507:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
        !           508:        return;
        !           509:    }
        !           510: 
        !           511:    if ((*s_objet_argument).type == CHN)
        !           512:    {
        !           513:        if (sem_unlink((unsigned char *) (*s_objet_argument).objet) != 0)
        !           514:        {
        !           515:            (*s_etat_processus).erreur_execution = d_ex_semaphore;
        !           516: 
        !           517:            liberation(s_etat_processus, s_objet_argument);
        !           518:            return;
        !           519:        }
        !           520:    }
        !           521:    else
        !           522:    {
        !           523:        liberation(s_etat_processus, s_objet_argument);
        !           524: 
        !           525:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
        !           526:        return;
        !           527:    }
        !           528: 
        !           529:    liberation(s_etat_processus, s_objet_argument);
        !           530: 
        !           531:    return;
        !           532: }
        !           533: 
        !           534: 
        !           535: /*
        !           536: ================================================================================
        !           537:   Fonction 'cond'
        !           538: ================================================================================
        !           539:   Entrées :
        !           540: --------------------------------------------------------------------------------
        !           541:   Sorties :
        !           542: --------------------------------------------------------------------------------
        !           543:   Effets de bord : néant
        !           544: ================================================================================
        !           545: */
        !           546: 
        !           547: void
        !           548: instruction_cond(struct_processus *s_etat_processus)
        !           549: {
        !           550:    struct_objet                    *s_objet_argument;
        !           551:    struct_objet                    *s_objet_resultat;
        !           552: 
        !           553:    (*s_etat_processus).erreur_execution = d_ex;
        !           554: 
        !           555:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !           556:    {
        !           557:        printf("\n  COND ");
        !           558: 
        !           559:        if ((*s_etat_processus).langue == 'F')
        !           560:        {
        !           561:            printf("(nombre de condition d'une matrice)\n\n");
        !           562:        }
        !           563:        else
        !           564:        {
        !           565:            printf("(matrix condition number)\n\n");
        !           566:        }
        !           567: 
        !           568:        printf("    1: %s, %s, %s\n", d_MIN, d_MRL, d_MCX);
        !           569:        printf("->  1: %s\n", d_REL);
        !           570:        return;
        !           571:    }
        !           572:    else if ((*s_etat_processus).test_instruction == 'Y')
        !           573:    {
        !           574:        (*s_etat_processus).nombre_arguments = -1;
        !           575:        return;
        !           576:    }
        !           577: 
        !           578:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !           579:    {
        !           580:        if (empilement_pile_last(s_etat_processus, 1) == d_erreur)
        !           581:        {
        !           582:            return;
        !           583:        }
        !           584:    }
        !           585: 
        !           586:    if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           587:            &s_objet_argument) == d_erreur)
        !           588:    {
        !           589:        (*s_etat_processus).erreur_execution = d_ex_manque_argument;
        !           590:        return;
        !           591:    }
        !           592: 
        !           593:    if (((*s_objet_argument).type == MIN) ||
        !           594:            ((*s_objet_argument).type == MRL) ||
        !           595:            ((*s_objet_argument).type == MCX))
        !           596:    {
        !           597:        if ((s_objet_resultat = allocation(s_etat_processus, REL)) == NULL)
        !           598:        {
        !           599:            (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !           600:            return;
        !           601:        }
        !           602: 
        !           603:        cond(s_etat_processus, (*s_objet_argument).objet,
        !           604:                (*s_objet_resultat).objet);
        !           605: 
        !           606:        if ((*s_etat_processus).erreur_systeme != d_es)
        !           607:        {
        !           608:            return;
        !           609:        }
        !           610: 
        !           611:        if (((*s_etat_processus).erreur_execution != d_ex) ||
        !           612:                ((*s_etat_processus).exception != d_ep))
        !           613:        {
        !           614:            liberation(s_etat_processus, s_objet_argument);
        !           615:            liberation(s_etat_processus, s_objet_resultat);
        !           616:            return;
        !           617:        }
        !           618:    }
        !           619:    else
        !           620:    {
        !           621:        liberation(s_etat_processus, s_objet_argument);
        !           622: 
        !           623:        (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument;
        !           624:        return;
        !           625:    }
        !           626: 
        !           627:    liberation(s_etat_processus, s_objet_argument);
        !           628: 
        !           629:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           630:            s_objet_resultat) == d_erreur)
        !           631:    {
        !           632:        return;
        !           633:    }
        !           634: 
        !           635:    return;
        !           636: }
        !           637: 
        !           638: 
        !           639: /*
        !           640: ================================================================================
        !           641:   Fonction 'clrerr'
        !           642: ================================================================================
        !           643:   Entrées :
        !           644: --------------------------------------------------------------------------------
        !           645:   Sorties :
        !           646: --------------------------------------------------------------------------------
        !           647:   Effets de bord : néant
        !           648: ================================================================================
        !           649: */
        !           650: 
        !           651: void
        !           652: instruction_clrerr(struct_processus *s_etat_processus)
        !           653: {
        !           654:    (*s_etat_processus).erreur_execution = d_ex;
        !           655: 
        !           656:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !           657:    {
        !           658:        printf("\n  CLRERR ");
        !           659: 
        !           660:        if ((*s_etat_processus).langue == 'F')
        !           661:        {
        !           662:            printf("(réinitialisation des erreurs)\n\n");
        !           663:            printf("  Aucun argument\n");
        !           664:        }
        !           665:        else
        !           666:        {
        !           667:            printf("(error reinitialization)\n\n");
        !           668:            printf("  No argument\n");
        !           669:        }
        !           670: 
        !           671:        return;
        !           672:    }
        !           673:    else if ((*s_etat_processus).test_instruction == 'Y')
        !           674:    {
        !           675:        (*s_etat_processus).nombre_arguments = -1;
        !           676:        return;
        !           677:    }
        !           678: 
        !           679:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !           680:    {
        !           681:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
        !           682:        {
        !           683:            return;
        !           684:        }
        !           685:    }
        !           686: 
        !           687:    (*s_etat_processus).derniere_exception = d_ep;
        !           688:    (*s_etat_processus).derniere_erreur_execution = d_ex;
        !           689:    (*s_etat_processus).derniere_erreur_systeme = d_es;
        !           690: 
        !           691:    return;
        !           692: }
        !           693: 
        !           694: 
        !           695: /*
        !           696: ================================================================================
        !           697:   Fonction 'currenc'
        !           698: ================================================================================
        !           699:   Entrées :
        !           700: --------------------------------------------------------------------------------
        !           701:   Sorties :
        !           702: --------------------------------------------------------------------------------
        !           703:   Effets de bord : néant
        !           704: ================================================================================
        !           705: */
        !           706: 
        !           707: void
        !           708: instruction_currenc(struct_processus *s_etat_processus)
        !           709: {
        !           710:    struct_objet                    *s_objet_resultat;
        !           711: 
        !           712:    (*s_etat_processus).erreur_execution = d_ex;
        !           713: 
        !           714:    if ((*s_etat_processus).affichage_arguments == 'Y')
        !           715:    {
        !           716:        printf("\n  CURRENC ");
        !           717: 
        !           718:        if ((*s_etat_processus).langue == 'F')
        !           719:        {
        !           720:            printf("(encodage interne des chaînes de caractères)\n\n");
        !           721:        }
        !           722:        else
        !           723:        {
        !           724:            printf("(internal strings encodage)\n\n");
        !           725:        }
        !           726: 
        !           727:        printf("->  1: %s\n", d_CHN);
        !           728:        return;
        !           729:    }
        !           730:    else if ((*s_etat_processus).test_instruction == 'Y')
        !           731:    {
        !           732:        (*s_etat_processus).nombre_arguments = -1;
        !           733:        return;
        !           734:    }
        !           735: 
        !           736:    if (test_cfsf(s_etat_processus, 31) == d_vrai)
        !           737:    {
        !           738:        if (empilement_pile_last(s_etat_processus, 0) == d_erreur)
        !           739:        {
        !           740:            return;
        !           741:        }
        !           742:    }
        !           743: 
        !           744:    if ((s_objet_resultat = allocation(s_etat_processus, CHN)) == NULL)
        !           745:    {
        !           746:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !           747:        return;
        !           748:    }
        !           749: 
        !           750:    if (((*s_objet_resultat).objet = malloc((strlen(d_locale) + 1) *
        !           751:            sizeof(unsigned char))) == NULL)
        !           752:    {
        !           753:        (*s_etat_processus).erreur_systeme = d_es_allocation_memoire;
        !           754:        return;
        !           755:    }
        !           756: 
        !           757:    strcpy((unsigned char *) (*s_objet_resultat).objet, d_locale);
        !           758: 
        !           759:    if (empilement(s_etat_processus, &((*s_etat_processus).l_base_pile),
        !           760:            s_objet_resultat) == d_erreur)
        !           761:    {
        !           762:        return;
        !           763:    }
        !           764: 
        !           765:    return;
        !           766: }
        !           767: 
        !           768: // vim: ts=4

CVSweb interface <joel.bertrand@systella.fr>