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

⟦5434769f1⟧ Ada Source

    Length: 7168 (0x1c00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package A_Strings, seg_04b91e

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



-- This package defines types and routines for manipulating
-- varying-length character strings, as a_string (access string).

-- SFZ\x091/21/86

with Unchecked_Conversion;
with System;

package A_Strings is

    type String_Rec (Len : Natural) is
        record
            S : String (1 .. Len);
        end record;
    type A_String is access String_Rec;

    function To_A_String is
       new Unchecked_Conversion (Source => System.Address, Target => A_String);

    Null_String_Rec : constant String_Rec (0) :=
       (Len => 0, S => (others => Ascii.Nul));

    Empty : constant A_String := To_A_String (Null_String_Rec'Address);

    type Convert_T is array (Character) of Character;
    To_Upper : constant Convert_T :=
       (Ascii.Nul, Ascii.Soh, Ascii.Stx, Ascii.Etx, Ascii.Eot, Ascii.Enq,
        Ascii.Ack, Ascii.Bel, Ascii.Bs, Ascii.Ht, Ascii.Lf, Ascii.Vt, Ascii.Ff,
        Ascii.Cr, Ascii.So, Ascii.Si, Ascii.Dle, Ascii.Dc1, Ascii.Dc2,
        Ascii.Dc3, Ascii.Dc4, Ascii.Nak, Ascii.Syn, Ascii.Etb, Ascii.Can,
        Ascii.Em, Ascii.Sub, Ascii.Esc, Ascii.Fs, Ascii.Gs, Ascii.Rs, Ascii.Us,
        ' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-',
        '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';',
        '<', '=', '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
        'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
        'X', 'Y', 'Z', '[', '\', ']', '^', '_', '`', 'A', 'B', 'C', 'D', 'E',
        'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
        'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', Ascii.Del);
    To_Lower : constant Convert_T :=
       (Ascii.Nul, Ascii.Soh, Ascii.Stx, Ascii.Etx, Ascii.Eot, Ascii.Enq,
        Ascii.Ack, Ascii.Bel, Ascii.Bs, Ascii.Ht, Ascii.Lf, Ascii.Vt, Ascii.Ff,
        Ascii.Cr, Ascii.So, Ascii.Si, Ascii.Dle, Ascii.Dc1, Ascii.Dc2,
        Ascii.Dc3, Ascii.Dc4, Ascii.Nak, Ascii.Syn, Ascii.Etb, Ascii.Can,
        Ascii.Em, Ascii.Sub, Ascii.Esc, Ascii.Fs, Ascii.Gs, Ascii.Rs, Ascii.Us,
        ' ', '!', '"', '#', '$', '%', '&', ''', '(', ')', '*', '+', ',', '-',
        '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';',
        '<', '=', '>', '?', '@', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
        'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
        'x', 'y', 'z', '[', '\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e',
        'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
        't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', Ascii.Del);

    function To_C (S : A_String) return System.Address;
    function To_A (S : String) return A_String;
    function To_A (C : Character) return A_String;

    function "&" (S : A_String; T : A_String) return A_String;
    function "&" (S : String; T : A_String) return A_String;
    function "&" (S : A_String; T : String) return A_String;
    function "&" (S : Character; T : A_String) return A_String;
    function "&" (S : A_String; T : Character) return A_String;

    function Insert (S : A_String; Into : A_String; At_Char : Natural)
                    return A_String;
    function Insert (S : String; Into : A_String; At_Char : Natural)
                    return A_String;
    function Insert (S : Character; Into : A_String; At_Char : Natural)
                    return A_String;
    function Change (S : A_String; At_Char, To_Char : Natural; Into : A_String)
                    return A_String;
    function Change (S : A_String; At_Char, To_Char : Natural; Into : String)
                    return A_String;

    -- the following routines return 0 if the pattern does not occur in S;
    -- otherwise they return the index of the start of the pattern in S.
    function Has (Pattern, S : A_String; Start : Natural := 1) return Integer;
    function Has (Pattern : String; S : A_String; Start : Natural := 1)
                 return Integer;
    function Has (Pattern : Character; S : A_String; Start : Natural := 1)
                 return Integer;

    Not_Found : exception;

    function Next (Pattern, S : A_String; Start : Natural := 1) return Natural;
    function Next (Pattern : String; S : A_String; Start : Natural := 1)
                  return Natural;
    function Next (Pattern : Character; S : A_String; Start : Natural := 1)
                  return Natural;
    function Last (Pattern, S : A_String; Start : Natural := 1) return Natural;
    function Last (Pattern : String; S : A_String; Start : Natural := 1)
                  return Natural;
    function Last (Pattern : Character; S : A_String; Start : Natural := 1)
                  return Natural;

    function Substitute (For_Pattern, To_Pattern : String; S : A_String)
                        return A_String;

    function Reverse_Order (S : A_String) return A_String;
    function Truncate (S : A_String; At_Char : Natural) return A_String;
    function Trim (S : A_String) return A_String;

    function Pad_Left
                (S : A_String; To_Length : Natural; Pad_Char : Character := ' ')
                return A_String;
    function Pad_Right
                (S : A_String; To_Length : Natural; Pad_Char : Character := ' ')
                return A_String;

    function Copy (S : A_String) return A_String;
    function Lower_To_Upper (S : A_String) return A_String;
    function Upper_To_Lower (S : A_String) return A_String;
    function Translate
                (From_Old, To_New : String; S : A_String) return A_String;

    function Is_Null (S : A_String) return Boolean;
    function Is_Empty (S : A_String) return Boolean;

    function Allocate (Size : Integer) return A_String;
    procedure Free (S : A_String);

end A_Strings;

E3 Meta Data

    nblk1=6
    nid=0
    hdr6=c
        [0x00] rec0=1f rec1=00 rec2=01 rec3=00a
        [0x01] rec0=0d rec1=00 rec2=02 rec3=04a
        [0x02] rec0=10 rec1=00 rec2=03 rec3=058
        [0x03] rec0=12 rec1=00 rec2=04 rec3=068
        [0x04] rec0=16 rec1=00 rec2=05 rec3=01c
        [0x05] rec0=17 rec1=00 rec2=06 rec3=000
    tail 0x21750b7d8868434931122 0x42a00088462060003