DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦8f8ad1c14⟧ TextFile

    Length: 11671 (0x2d97)
    Types: TextFile
    Names: »B«

Derivation

└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00
    └─ ⟦0c20f784e⟧ »DATA« 
        └─⟦1abbe589f⟧ 
            └─⟦591c5b094⟧ 
                └─⟦this⟧ 

TextFile

with Arithmetic;
use Arithmetic;
with Vstring_Case;
use Vstring_Case;
with Vstring_Type;
use Vstring_Type;

package body Vstring_Equal is
------------------------------------------------------------------------------
-- VString Equality Tests
------------------------------------------------------------------------------
-- Copyright 1988 - 1991 by Rational, Santa Clara, California.
--
--                  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 name of Rational not be used in
-- advertising or publicity pertaining to distribution of the software
-- without specific, written prior permission.
--
-- Rational disclaims all warranties with regard to this software, including
-- all implied warranties of merchantability and fitness, in no event shall
-- 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.
------------------------------------------------------------------------------

--\f

    function Equal (Vstr1 : Vstring_Data;  
                    Vstr2 : Vstring_Data) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Vstr1.Chars (I) /= Vstr2.Chars (I) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Equal (Vstr1 : Vstring_Data;  
                    Vstr2 : Vstring) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Vstr1.Chars (I) /= Vstr2.Chars (I) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Equal (Vstr1 : Vstring;  
                    Vstr2 : Vstring_Data) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Vstr1.Chars (I) /= Vstr2.Chars (I) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Equal (Vstr1 : Vstring;  
                    Vstr2 : Vstring) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Vstr1.Chars (I) /= Vstr2.Chars (I) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Equal (Vstr1 : Vstring_Data;  
                    Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length = Vstr2'Length then
            for I in reverse 0 .. Vstr1.Length - 1 loop
                if Vstr1.Chars (I + 1) /= Vstr2 (I + Vstr2'First) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Equal (Vstr1 : Vstring_Data;  
                    Vstr2 : Character) return Boolean is
    begin
        return Vstr1.Length /= 1 or else Vstr1.Chars (1) /= Vstr2;
    end Equal;

--\f

    function Equal (Vstr1  : Vstring_Data;  
                    Vstr2  : Character;  
                    Copies : S_Natural) return Boolean is
    begin
        if Vstr1.Length = Copies then
            for I in reverse 1 .. Copies loop
                if Vstr1.Chars (I) /= Vstr2 then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Equal (Vstr1 : Vstring;  
                    Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length = Vstr2'Length then
            for I in reverse 0 .. Vstr1.Length - 1 loop
                if Vstr1.Chars (I + 1) /= Vstr2 (I + Vstr2'First) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Equal (Vstr1 : Vstring;  
                    Vstr2 : Character) return Boolean is
    begin
        return Vstr1.Length /= 1 or else Vstr1.Chars (1) /= Vstr2;
    end Equal;

--\f

    function Equal (Vstr1  : Vstring;  
                    Vstr2  : Character;  
                    Copies : S_Natural) return Boolean is
    begin
        if Vstr1.Length = Copies then
            for I in reverse 1 .. Copies loop
                if Vstr1.Chars (I) /= Vstr2 then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring_Data;  
                       Vstr2 : Vstring_Data) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Uc_Char (Vstr1.Chars (I)) /= Uc_Char (Vstr2.Chars (I)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring_Data;  
                       Vstr2 : Vstring) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Uc_Char (Vstr1.Chars (I)) /= Uc_Char (Vstr2.Chars (I)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring;  
                       Vstr2 : Vstring_Data) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Uc_Char (Vstr1.Chars (I)) /= Uc_Char (Vstr2.Chars (I)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring;  
                       Vstr2 : Vstring) return Boolean is
    begin
        if Vstr1.Length = Vstr2.Length then
            for I in reverse 1 .. Vstr1.Length loop
                if Uc_Char (Vstr1.Chars (I)) /= Uc_Char (Vstr2.Chars (I)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring_Data;  
                       Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length = Vstr2'Length then
            for I in reverse 0 .. Vstr1.Length - 1 loop
                if Uc_Char (Vstr1.Chars (I + 1)) /=
                   Uc_Char (Vstr2 (I + Vstr2'First)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring_Data;  
                       Vstr2 : Character) return Boolean is
    begin
        return Vstr1.Length /= 1 or else
                  Uc_Char (Vstr1.Chars (1)) /= Uc_Char (Vstr2);
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1  : Vstring_Data;  
                       Vstr2  : Character;  
                       Copies : S_Natural) return Boolean is
        Chr : constant Character := Uc_Char (Vstr2);
    begin
        if Vstr1.Length = Copies then
            for I in reverse 1 .. Copies loop
                if Uc_Char (Vstr1.Chars (I)) /= Chr then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring;  
                       Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length = Vstr2'Length then
            for I in reverse 0 .. Vstr1.Length - 1 loop
                if Uc_Char (Vstr1.Chars (I + 1)) /=
                   Uc_Char (Vstr2 (I + Vstr2'First)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1 : Vstring;  
                       Vstr2 : Character) return Boolean is
    begin
        return Vstr1.Length /= 1 or else
                  Uc_Char (Vstr1.Chars (1)) /= Uc_Char (Vstr2);
    end Uc_Equal;

--\f

    function Uc_Equal (Vstr1  : Vstring;  
                       Vstr2  : Character;  
                       Copies : S_Natural) return Boolean is
        Chr : constant Character := Uc_Char (Vstr2);
    begin
        if Vstr1.Length = Copies then
            for I in reverse 1 .. Copies loop
                if Uc_Char (Vstr1.Chars (I)) /= Chr then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal;

--\f

    function Equal_Prefix (Vstr1 : Vstring_Data;  
                           Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length >= Vstr2'Length then
            for I in reverse S_Natural range 0 .. Vstr2'Length - 1 loop
                if Vstr1.Chars (I + 1) /= Vstr2 (I + Vstr2'First) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal_Prefix;

--\f

    function Equal_Prefix (Vstr1 : Vstring;  
                           Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length >= Vstr2'Length then
            for I in reverse S_Natural range 0 .. Vstr2'Length - 1 loop
                if Vstr1.Chars (I + 1) /= Vstr2 (I + Vstr2'First) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Equal_Prefix;

--\f

    function Uc_Equal_Prefix (Vstr1 : Vstring_Data;  
                              Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length >= Vstr2'Length then
            for I in reverse S_Natural range 0 .. Vstr2'Length - 1 loop
                if Uc_Char (Vstr1.Chars (I + 1)) /=
                   Uc_Char (Vstr2 (I + Vstr2'First)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal_Prefix;

--\f

    function Uc_Equal_Prefix (Vstr1 : Vstring;  
                              Vstr2 : E_String) return Boolean is
    begin
        if Vstr1.Length >= Vstr2'Length then
            for I in reverse S_Natural range 0 .. Vstr2'Length - 1 loop
                if Uc_Char (Vstr1.Chars (I + 1)) /=
                   Uc_Char (Vstr2 (I + Vstr2'First)) then
                    return False;
                end if;
            end loop;
            return True;
        end if;
        return False;
    end Uc_Equal_Prefix;

--\f

end Vstring_Equal;