|
|
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: 5120 (0x1400)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Serial_Io, seg_03ccfd
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with System;
with Text_Io;
package body Serial_Io is
procedure Read_String_C (C_Message : System.Address;
C_Tty : System.Address;
C_Length : System.Address);
pragma Interface (C, Read_String_C);
pragma Interface_Information (Read_String_C, ".read_string");
procedure Write_String_C (C_Message : System.Address;
C_Tty : System.Address;
C_Length : Integer);
pragma Interface (C, Write_String_C);
pragma Interface_Information (Write_String_C, ".write_string");
procedure Write_Char_C (C_Message : Interchange.Byte;
C_Tty : System.Address);
pragma Interface (C, Write_Char_C);
pragma Interface_Information (Write_Char_C, ".write_char");
procedure Put (S : String; Tty : String) is
C_Message : constant String := S;
C_Tty : constant String := Tty & Ascii.Nul;
begin
Write_String_C (C_Message => C_Message (C_Message'First)'Address,
C_Tty => C_Tty (C_Tty'First)'Address,
C_Length => C_Message'Length);
end Put;
procedure Put (B : Interchange.Byte; Tty : String) is
C_Tty : constant String := Tty & Ascii.Nul;
begin
Write_Char_C (C_Message => B, C_Tty => C_Tty (C_Tty'First)'Address);
end Put;
procedure Put (Bs : Interchange.Byte_String; Tty : String) is
C_Tty : constant String := Tty & Ascii.Nul;
begin
Write_String_C (C_Message => Bs (Bs'First)'Address,
C_Tty => C_Tty (C_Tty'First)'Address,
C_Length => Bs'Length);
end Put;
function Get (Tty : String) return Interchange.Byte_String is
Buf : Interchange.Byte_String (1 .. 1024);
C_Tty : constant String := Tty & Ascii.Nul;
Cnt : Integer := 0;
begin
Read_String_C (C_Message => Buf'Address,
C_Tty => C_Tty (C_Tty'First)'Address,
C_Length => Cnt'Address);
Text_Io.Put_Line ("get: cnt=>" & Integer'Image (Cnt));
return Buf (Buf'First .. Cnt);
end Get;
function Invoke (S : Interchange.Byte_String; Tty : String)
return Interchange.Byte_String is
begin
Put (S, Tty);
return Get (Tty);
end Invoke;
end Serial_Io;
nblk1=4
nid=0
hdr6=8
[0x00] rec0=1a rec1=00 rec2=01 rec3=006
[0x01] rec0=01 rec1=00 rec2=04 rec3=00e
[0x02] rec0=1b rec1=00 rec2=03 rec3=03c
[0x03] rec0=0f rec1=00 rec2=02 rec3=000
tail 0x215354b1085e275499da3 0x42a00088462060003