DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦d95442cbf⟧ Ada Source

    Length: 6144 (0x1800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Operations, seg_0571c8

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with Text_Io;
with String_Utilities;
with Bounded_String;
use Bounded_String;

package body Operations is


    --************************************************************
    function Egal (Left, Right : Variable_String) return Boolean is
        -- Compare deux chaines (uniquement la partie "contrat"
        -- de celles-ci), retourne True si elles sont egales.
    begin
        return String_Utilities.Equal (Image (Separe_Contrat (Left)),
                                       Image (Separe_Contrat (Right)), False);
    end Egal;


    --************************************************************
    function Separe_Contrat (Chaine : Variable_String) return Variable_String is
        -- Separe la partie "utile", c a dire ce qu'il y a avant
        -- la parenthese "(", si toutefois elle existe.
        Contrat : Variable_String (1024);
        Symbole : Character := '('; -- Ceci est le symbole a rechercher
        Long : Positive;
        Debut : Positive := 1;
    begin
        Copy (Contrat, Chaine);
        Long := Length (Chaine);

        -- Cherche la position "Debut" du symbole
        while Debut <= Long loop
            if Char_At (Contrat, Debut) /= Symbole then  
                Debut := Debut + 1;
            else
                exit;
            end if;
        end loop;

        if Debut <= Long then
            --Efface ce qui suit le contrat: les (...)
            Delete (Contrat, Debut, Long - Debut + 1);
        end if;

        return Contrat;
        -- Si la "(" a ete trouvee, le contrat est retourne
        -- Sinon c'est tout le champ "Commande"
    end Separe_Contrat;


    --************************************************************
    function Separe_Param (Chaine : Variable_String; Numero : Positive)
                          return Variable_String is
        --Renvoie le contenu du sous-champ No. Numero
        --...contenu dans Chaine
        Contrat : Bounded_String.Variable_String (1024);
        Debut : Positive := 1;
        Long : Positive;
        Compteur : Positive := 1;
    begin
        Bounded_String.Copy (Contrat, Chaine);

        --Trouve la position du Numero'ieme "$" (debut)
        while Compteur /= Numero + 1 loop
            while Char_At (Contrat, Debut) /= '$' loop
                Debut := Debut + 1;
            end loop;
            Compteur := Compteur + 1;
            Debut := Debut + 1;
        end loop;

        --Efface le debut
        Delete (Contrat, 1, Debut - 1);

        Compteur := 1;
        Long := Length (Contrat);

        --Trouve la position du prochain "$" (fin)
        while Char_At (Contrat, Compteur) /= '$' loop
            Compteur := Compteur + 1;
        end loop;

        --Efface la fin, et retourne la portion demandee (No. Numero)
        Delete (Contrat, Compteur, Long - Compteur + 1);

        return Contrat;
    end Separe_Param;

end Operations;

E3 Meta Data

    nblk1=5
    nid=5
    hdr6=8
        [0x00] rec0=1b rec1=00 rec2=01 rec3=018
        [0x01] rec0=1e rec1=00 rec2=03 rec3=01c
        [0x02] rec0=20 rec1=00 rec2=04 rec3=000
        [0x03] rec0=02 rec1=00 rec2=02 rec3=000
        [0x04] rec0=c0 rec1=00 rec2=00 rec3=100
    tail 0x21763d6c887c6496d9821 0x42a00088462060003
Free Block Chain:
  0x5: 0000  00 00 00 12 80 0f 74 65 6e 75 20 64 75 20 73 6f  ┆      tenu du so┆