|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 14336 (0x3800) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Vstring_Compare, seg_005837
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦5a81ac88f⟧ »Space Info Vol 1« └─⟦this⟧
with Arithmetic; use Arithmetic; with Vstring_Type; use Vstring_Type; package body Vstring_Compare is ------------------------------------------------------------------------------ -- VString Comparison Routines ------------------------------------------------------------------------------ -- 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. ------------------------------------------------------------------------------ --\x0c function Compare (Vstr1 : Vstring_Data; Vstr2 : Vstring_Data) return Result_Type is Len : S_Natural := Vstr1.Length; Result : Result_Type := -1; Diff : S_Long; begin if Len > Vstr2.Length then Len := Vstr2.Length; Result := 1; end if; for I in 1 .. Len loop Diff := Character'Pos (Vstr1.Chars (I)) - Character'Pos (Vstr2.Chars (I)); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Vstr2.Length then return 0; end if; return Result; end Compare; --\x0c function Compare (Vstr1 : Vstring_Data; Vstr2 : Vstring) return Result_Type is Len : S_Natural := Vstr1.Length; Result : Result_Type := -1; Diff : S_Long; begin if Len > Vstr2.Length then Len := Vstr2.Length; Result := 1; end if; for I in 1 .. Len loop Diff := Character'Pos (Vstr1.Chars (I)) - Character'Pos (Vstr2.Chars (I)); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Vstr2.Length then return 0; end if; return Result; end Compare; --\x0c function Compare (Vstr1 : Vstring; Vstr2 : Vstring_Data) return Result_Type is Len : S_Natural := Vstr1.Length; Result : Result_Type := -1; Diff : S_Long; begin if Len > Vstr2.Length then Len := Vstr2.Length; Result := 1; end if; for I in 1 .. Len loop Diff := Character'Pos (Vstr1.Chars (I)) - Character'Pos (Vstr2.Chars (I)); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Vstr2.Length then return 0; end if; return Result; end Compare; --\x0c function Compare (Vstr1 : Vstring; Vstr2 : Vstring) return Result_Type is Len : S_Natural := Vstr1.Length; Result : Result_Type := -1; Diff : S_Long; begin if Len > Vstr2.Length then Len := Vstr2.Length; Result := 1; end if; for I in 1 .. Len loop Diff := Character'Pos (Vstr1.Chars (I)) - Character'Pos (Vstr2.Chars (I)); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Vstr2.Length then return 0; end if; return Result; end Compare; --\x0c function Compare (Vstr1 : Vstring_Data; Vstr2 : E_String) return Result_Type is Len : S_Natural := Vstr2'Length; Result : Result_Type := 1; Diff : S_Long; begin if Len > Vstr1.Length then Len := Vstr1.Length; Result := -1; end if; for I in 0 .. Len - 1 loop Diff := Character'Pos (Vstr1.Chars (I + 1)) - Character'Pos (Vstr2 (I + Vstr2'First)); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Vstr2'Length then return 0; end if; return Result; end Compare; --\x0c function Compare (Vstr1 : Vstring_Data; Vstr2 : Character) return Result_Type is begin if Vstr1.Length = 0 then return -1; end if; return Character'Pos (Vstr1.Chars (1)) - Character'Pos (Vstr2); end Compare; --\x0c function Compare (Vstr1 : Vstring_Data; Vstr2 : Character; Copies : S_Natural) return Result_Type is Len : S_Natural := Vstr1.Length; Result : Result_Type := -1; Diff : S_Long; begin if Len > Copies then Len := Copies; Result := 1; end if; for I in 1 .. Len loop Diff := Character'Pos (Vstr1.Chars (I)) - Character'Pos (Vstr2); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Copies then return 0; end if; return Result; end Compare; --\x0c function Compare (Vstr1 : Vstring; Vstr2 : E_String) return Result_Type is Len : S_Natural := Vstr2'Length; Result : Result_Type := 1; Diff : S_Long; begin if Len > Vstr1.Length then Len := Vstr1.Length; Result := -1; end if; for I in 0 .. Len - 1 loop Diff := Character'Pos (Vstr1.Chars (I + 1)) - Character'Pos (Vstr2 (I + Vstr2'First)); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Vstr2'Length then return 0; end if; return Result; end Compare; --\x0c function Compare (Vstr1 : Vstring; Vstr2 : Character) return Result_Type is begin if Vstr1.Length = 0 then return -1; end if; return Character'Pos (Vstr1.Chars (1)) - Character'Pos (Vstr2); end Compare; --\x0c function Compare (Vstr1 : Vstring; Vstr2 : Character; Copies : S_Natural) return Result_Type is Len : S_Natural := Vstr1.Length; Result : Result_Type := -1; Diff : S_Long; begin if Len > Copies then Len := Copies; Result := 1; end if; for I in 1 .. Len loop Diff := Character'Pos (Vstr1.Chars (I)) - Character'Pos (Vstr2); if Diff /= 0 then return Diff; end if; end loop; if Vstr1.Length = Copies then return 0; end if; return Result; end Compare; --\x0c end Vstring_Compare;
nblk1=d nid=0 hdr6=1a [0x00] rec0=18 rec1=00 rec2=01 rec3=010 [0x01] rec0=16 rec1=00 rec2=02 rec3=00e [0x02] rec0=00 rec1=00 rec2=0d rec3=014 [0x03] rec0=23 rec1=00 rec2=03 rec3=038 [0x04] rec0=00 rec1=00 rec2=0c rec3=014 [0x05] rec0=20 rec1=00 rec2=04 rec3=01e [0x06] rec0=01 rec1=00 rec2=0b rec3=024 [0x07] rec0=1f rec1=00 rec2=05 rec3=022 [0x08] rec0=00 rec1=00 rec2=0a rec3=014 [0x09] rec0=21 rec1=00 rec2=06 rec3=00e [0x0a] rec0=00 rec1=00 rec2=09 rec3=014 [0x0b] rec0=23 rec1=00 rec2=07 rec3=002 [0x0c] rec0=20 rec1=00 rec2=08 rec3=000 tail 0x21500aefe81978f013b3b 0x42a00088462063203