------------------------------------------------------------------------------ -- PURPOSE: R1000 version of generic_seq_binary_file_io package Body -- for Network Protocols . -- -- -- NOTES: This program was produced by the Westinghouse Electric Corporation, -- as part of the STARS Foundation Ada Software procurement effort. -- -- (c) Copyright 1987 Westinghouse Electric Corporation -- (c) Copyright 1988 Westinghouse Electric Corporation - Updates -- All Rights Reserved. -- -- This material may be reproduced by or for the U.S. Government -- pursuant to the copyright licence under DOD FAR Suppl. Clause -- 52.227-7013 August 1984. -- Author : Elizabeth T. Hobbs -------------------------------------------------------------------------------- with Sequential_Io; separate (Network_Protocols) package body Generic_Seq_Binary_File_Io is package Seq_Io is new Sequential_Io (Byte); Ifile, Ofile : Seq_Io.File_Type; procedure Open_Read (Name : String; Form : String := "") is begin Seq_Io.Open (Ifile, Seq_Io.In_File, Name, Form); end Open_Read; procedure F_Read (C : out Byte; Eofile : out Boolean) is begin C := Byte'Val (Character'Pos (Ascii.Nul)); Seq_Io.Read (Ifile, C); Eofile := False; exception when Seq_Io.End_Error => Eofile := True; end F_Read; procedure Close_Read is begin Seq_Io.Close (Ifile); end Close_Read; procedure Open_Write (Name : String; Form : String := "") is begin Seq_Io.Create (Ofile, Seq_Io.Out_File, Name, Form); end Open_Write; procedure F_Write (C : Byte) is begin Seq_Io.Write (Ofile, C); end F_Write; procedure Close_Write is begin Seq_Io.Close (Ofile); end Close_Write; function Name_Of_File_Being_Transferred return String is begin return Seq_Io.Name (Ifile); end Name_Of_File_Being_Transferred; end Generic_Seq_Binary_File_Io;