|
|
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: 7168 (0x1c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Message, seg_052f2f
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦cfc2e13cd⟧ »Space Info Vol 2«
└─⟦this⟧
package body Message is
function Initialize (Op : Kind_Of_Message;
L_S : Transport_Defs.Socket_Id;
R_S : Transport_Defs.Socket_Id;
R_H : My_String;
Jo : Positive;
Com : My_String) return Object is
Element : Object;
begin
Element.Operation := Op;
Element.Local_Socket := L_S;
Element.Remote_Socket := R_S;
Bounded_String.Copy (Element.Remote_Host, R_H);
Element.Job := Jo;
Bounded_String.Copy (Element.Comment, Com);
return Element;
end Initialize;
function Record_To_String (Mess : Object) return My_String is
Buffer : My_String;
begin
Bounded_String.Copy
(Buffer, "#" & Message.Kind_Of_Message'Image (Mess.Operation) &
"#" & Integer'Image (Utils.Byte_String_To_Integer
(Byte_Defs.Byte_String
(Mess.Local_Socket))) &
"#" & Utils.Byte_String_To_String
(Byte_Defs.Byte_String (Mess.Remote_Socket)) &
"#" & Bounded_String.Image (Mess.Remote_Host) &
"#" & Positive'Image (Mess.Job) & "#" &
Bounded_String.Image (Mess.Comment) & "#");
return Buffer;
end Record_To_String;
function String_To_Record (Mess : My_String) return Object is
Separator : Character := '#';
Op : Kind_Of_Message;
Crt, Last : Positive;
Element : Object;
function Extract return String is
Buffer : My_String;
begin
while Bounded_String.Char_At (Mess, Crt) /= Separator loop
Text_Io.Put_Line ("valeur de crt: " & Positive'Image (Crt));
Text_Io.Put (Bounded_String.Char_At (Mess, Crt));
Bounded_String.Append (Buffer,
Bounded_String.Char_At (Mess, Crt));
Crt := Crt + 1;
end loop;
Text_Io.Put (Bounded_String.Char_At (Mess, Crt));
Text_Io.Put_Line ("Fin de boucle");
if Bounded_String.Image (Buffer) = "" then
Text_Io.Put_Line ("coucou");
Crt := Crt + 1;
Bounded_String.Copy (Buffer, Extract);
end if;
Text_Io.Put_Line ("buffer: " & Bounded_String.Image (Buffer));
Crt := Crt + 1;
-- Text_Io.Put ("Hello:" & Bounded_String.Char_At (Mess, Crt));
return Bounded_String.Image (Buffer);
end Extract;
begin
Text_Io.Put_Line (Bounded_String.Image (Mess));
Crt := 1;
if Bounded_String.Char_At (Mess, Crt) = Separator then
Crt := Crt + 1;
Text_Io.Put_Line ("Premier separateur repere");
else
Text_Io.Put_Line ("Premier separateur manquant");
end if;
Kind_Of_Mess_Io.Get (Extract, Op,
Last); -- Transforme un string en enumeration
Element :=
Initialize (Op => Op,
L_S => Transport_Defs.Socket_Id
(Utils.String_To_Byte_String (Extract)),
R_S => Transport_Defs.Socket_Id
(Utils.String_To_Byte_String (Extract)),
R_H => Bounded_String.Value (Extract),
Jo => Positive'Value (Extract),
Com => Bounded_String.Value (Extract));
return Element;
-- A VIRER
return Object'
(Operation => Op,
Local_Socket => Transport_Defs.Socket_Id
(Utils.String_To_Byte_String (Extract)),
Remote_Socket => Transport_Defs.Socket_Id
(Utils.String_To_Byte_String (Extract)),
Remote_Host => Bounded_String.Value (Extract),
Job => Positive'Value (Extract),
Comment => Bounded_String.Value (Extract));
end String_To_Record;
end Message;
nblk1=6
nid=2
hdr6=a
[0x00] rec0=1c rec1=00 rec2=01 rec3=030
[0x01] rec0=15 rec1=00 rec2=06 rec3=044
[0x02] rec0=16 rec1=00 rec2=05 rec3=022
[0x03] rec0=16 rec1=00 rec2=03 rec3=092
[0x04] rec0=0b rec1=00 rec2=04 rec3=000
[0x05] rec0=09 rec1=00 rec2=02 rec3=000
tail 0x2175aa44087a8846469c7 0x42a00088462060003
Free Block Chain:
0x2: 0000 00 00 01 6a 80 23 5f 53 6f 63 6b 65 74 20 3d 3e ┆ j #_Socket =>┆