DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 3703 (0xe77) Types: TextFile Names: »B«
└─⟦85b835f43⟧ Bits:30000549 8mm tape, Rational 1000, Xlib rev 6.00 └─ ⟦0c20f784e⟧ »DATA« └─⟦1abbe589f⟧ └─⟦059497ac5⟧ └─⟦this⟧
with Xlbt_Arithmetic; use Xlbt_Arithmetic; package body Xlbp_U_Char_Converters is ------------------------------------------------------------------------------ -- X Library Basic Converters -- -- Xlbp_U_Char_Converters - Conversion to/from U_Char_Array. ------------------------------------------------------------------------------ -- Copyright 1990 - 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 procedure To_Uca (Uca : out U_Char_Array; Str : String) is ------------------------------------------------------------------------------ -- Convert a normal 7-bit Ada string into an U_Char_Array. ------------------------------------------------------------------------------ Str_Last : Integer := Str'Last; begin if Str'Length /= Uca'Length then raise Constraint_Error; else for I in reverse Uca'Range loop Uca (I) := Character'Pos (Str (Str_Last)); Str_Last := Str_Last - 1; end loop; end if; end To_Uca; --\f procedure From_Uca (Str : out String; Uca : U_Char_Array) is ------------------------------------------------------------------------------ -- Convert an U_Char_Array into a normal 7-bit string. Chop each -- character to 7 bits as we go. ------------------------------------------------------------------------------ Uca_Last : S_Long := Uca'Last; begin if Str'Length /= Uca'Length then raise Constraint_Error; else for I in reverse Str'Range loop Str (I) := Character'Val (Uca (Uca_Last) rem 128); Uca_Last := Uca_Last - 1; end loop; end if; end From_Uca; --\f procedure From_Uca (Str : out String; Uca : U_Char_Array; Trans : U_Character_Array) is ------------------------------------------------------------------------------ -- Convert an U_Char_Array into a normal 7-bit string. Translates -- each U_Char in the Uca via the Trans array and returns that result. ------------------------------------------------------------------------------ Uca_Last : S_Long := Uca'Last; begin if Str'Length /= Uca'Length then raise Constraint_Error; else for I in reverse Str'Range loop Str (I) := Trans (Uca (Uca_Last)); Uca_Last := Uca_Last - 1; end loop; end if; end From_Uca; --\f end Xlbp_U_Char_Converters;