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

⟦cb93dbe49⟧ Ada Source

    Length: 8192 (0x2000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Xlbt_String, seg_004ff1

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 Unchecked_Deallocation;

package body Xlbt_String is
------------------------------------------------------------------------------
-- X Library 8-bit character types
--
-- Xlbt_String - Full 8-bit Ascii strings (Non-Ada Strings)
------------------------------------------------------------------------------
-- Copyright 1989 - 1991 by Rational, Santa Clara, California.
-- Copyright 1985 - 1989 by the Massachusetts Institute of Technology
--
--                  All Rights Reserved.
--
-- Permission to use, copy, modify, and distribute this software and its
-- documentation for any purpose and without fee is hereby granted,
-- provided that the above copyright notice(s) appear in all copies and that
-- both that copyright notice(s) and this permission notice appear in
-- supporting documentation, and that the names of MIT or Rational not be
-- used in advertising or publicity pertaining to distribution of the software
-- without specific, written prior permission.
--
-- MIT and Rational disclaim all warranties with regard to this software,
-- including all implied warranties of merchantability and fitness, in no
-- event shall MIT or Rational be liable for any special, indirect or
-- consequential damages or any damages whatsoever resulting from loss of use,
-- data or profits, whether in an action of contract, negligence or other
-- tortious action, arising out of or in connection with the use or performance
-- of this software.
------------------------------------------------------------------------------

--\x0c
    procedure Heap_Free_X_String_Pointer_List is  
       new Unchecked_Deallocation (X_String_Pointer_Array,  
                                   X_String_Pointer_List);

--\x0c
    ------------------------------------------------------------------------------
-- X_String_Pointer
------------------------------------------------------------------------------

    procedure Free_X_String_Pointer_Array  
                 (List : in out X_String_Pointer_Array) is  
        Sp : X_String_Pointer;  
    begin  
        for I in List'Range loop  
            if List (I) /= null then  
                Sp := X_String_Pointer (List (I));  
                Free_X_String_Pointer (Sp);  
                List (I) := null;  
            end if;  
        end loop;  
    end Free_X_String_Pointer_Array;

--\x0c
    procedure Free_X_String_Pointer_List  
                 (List : in out X_String_Pointer_List) is  
    begin  
        if List = None_X_String_Pointer_List then  
            return;  
        end if;  
        Free_X_String_Pointer_Array (List.all);  
        Heap_Free_X_String_Pointer_List (List);  
    end Free_X_String_Pointer_List;

--\x0c
    function To_X_String (Str7 : String) return X_String is
------------------------------------------------------------------------------
-- Convert a normal 7-bit Ada string into an 8-bit X String.  The result
-- String is guaranteed to have array bounds 1..Str'length.
------------------------------------------------------------------------------
        Str8 : X_String (1 .. S_Natural (Str7'Length));  
    begin

        To_X_String (Str8, Str7);  
        return Str8;

    end To_X_String;

--\x0c
    function To_String (Str8 : X_String) return String is
------------------------------------------------------------------------------
-- Convert an 8-bit String into a normal 7-bit string.  The result
-- string is guaranteed to have array bounds 1..Str'length.  Chop each
-- character to 7 bits as we go.
------------------------------------------------------------------------------
        Str7 : String (1 .. Natural (Str8'Length));  
    begin

        To_String (Str7, Str8);  
        return Str7;

    end To_String;

--\x0c
    function To_String (Str8  : X_String;  
                        Trans : X_Translation_Array) return String is
------------------------------------------------------------------------------
-- Convert an 8-bit String into a normal 7-bit string.  The result
-- string is guaranteed to have array bounds 1..Str'length.  Translates
-- each Character8 in the Str via the Trans array and returns that result.
------------------------------------------------------------------------------
        Str7 : String (1 .. Natural (Str8'Length));  
    begin

        To_String (Str7, Str8, Trans);  
        return Str7;

    end To_String;

--\x0c
    procedure To_X_String (Str8 : out X_String;  
                           Str7 :     String) is
------------------------------------------------------------------------------
-- Convert a normal 7-bit Ada string into an 8-bit X String.  The result
-- String is guaranteed to have array bounds 1..Str'length.
------------------------------------------------------------------------------
        Str_Last : Natural := Str7'Last;  
    begin

        if Str8'Length /= Str7'Length then  
            raise Constraint_Error;  
        end if;  
        for I in reverse Str8'Range loop  
            Str8 (I) := X_Character'Val (Character'Pos (Str7 (Str_Last)));  
            Str_Last := Str_Last - 1;  
        end loop;

    end To_X_String;

--\x0c
    procedure To_String (Str7 : out String;  
                         Str8 :     X_String) is
------------------------------------------------------------------------------
-- Convert an 8-bit String into a normal 7-bit string.  The result
-- string is guaranteed to have array bounds 1..Str'length.  Chop each
-- character to 7 bits as we go.
------------------------------------------------------------------------------
    begin

        if Str8'Length /= Str7'Length then  
            raise Constraint_Error;  
        end if;  
        for I in S_Natural range 0 .. Str8'Length - 1 loop  
            Str7 (Str7'First + Natural (I)) :=  
               Character'Val (X_Character'Pos (Str8 (Str8'First + I)) rem 128);  
        end loop;

    end To_String;

--\x0c
    procedure To_String (Str7  : out String;  
                         Str8  :     X_String;  
                         Trans :     X_Translation_Array) is
------------------------------------------------------------------------------
-- Convert an 8-bit String into a normal 7-bit string.  The result
-- string is guaranteed to have array bounds 1..Str'length.  Translates
-- each Character8 in the Str via the Trans array and returns that result.
------------------------------------------------------------------------------
    begin

        if Str8'Length /= Str7'Length then  
            raise Constraint_Error;  
        end if;  
        for I in S_Natural range 0 .. Str8'Length - 1 loop  
            Str7 (Str7'First + Natural (I)) := Trans (Str8 (Str8'First + I));  
        end loop;

    end To_String;

--\x0c
end Xlbt_String;  

E3 Meta Data

    nblk1=7
    nid=0
    hdr6=e
        [0x00] rec0=15 rec1=00 rec2=01 rec3=052
        [0x01] rec0=16 rec1=00 rec2=02 rec3=00a
        [0x02] rec0=1b rec1=00 rec2=03 rec3=012
        [0x03] rec0=1c rec1=00 rec2=04 rec3=040
        [0x04] rec0=17 rec1=00 rec2=05 rec3=046
        [0x05] rec0=19 rec1=00 rec2=06 rec3=064
        [0x06] rec0=1b rec1=00 rec2=07 rec3=000
    tail 0x21700783681978528b5cb 0x42a00088462063203