File : posix-supplement_to_ada_io.adb


------------------------------------------------------------------------------
--                                                                          --
--            FLORIST (FSU Implementation of POSIX.5) COMPONENTS            --
--                                                                          --
--            P O S I X . S U P P L E M E N T _ T O _ A D A _ I O           --
--                                                                          --
--                                  B o d y                                 --
--                                                                          --
--                                                                          --
--  Copyright (c) 1996 Florida State University (FSU), All Rights Reserved. --
--                                                                          --
--  This file is a component of FLORIST, an  implementation of an  Ada API  --
--  for the POSIX OS services, for use with  the  GNAT  Ada  compiler  and  --
--  the FSU Gnu Ada Runtime Library (GNARL).   The  interface  is intended  --
--  to be close to that specified in  IEEE STD  1003.5: 1990  and IEEE STD  --
--  1003.5b: 1996.                                                          --
--                                                                          --
--  FLORIST is free software;  you can  redistribute  it and/or  modify it  --
--  under terms of the  GNU  General  Public  License as  published by the  --
--  Free Software Foundation;  either version  2, or (at  your option) any  --
--  later version.  FLORIST is distributed  in  the hope  that  it will be  --
--  useful, but WITHOUT ANY WARRANTY;  without  even the implied  warranty  --
--  of MERCHANTABILITY or FITNESS FOR A PARTICULAR  PURPOSE.  See  the GNU  --
--  General Public License for more details.  You  should have  received a  --
--  copy of the GNU General Public License  distributed  with  GNARL;  see  --
--  file  COPYING.  If not,  write to  the  Free  Software  Foundation, 59  --
--  Temple Place - Suite 330, Boston, MA 02111-1307, USA.                   --
--                                                                          --
--  As a special exception, if other files instantiate generics from  this  --
--  unit, or you link this unit with other files to produce an  executable, --
--  this  unit does not by itself cause the  resulting  executable  to  be  --
--  covered  by the  GNU  General  Public License. This exception does not  --
--  however invalidate any other  reasons why the executable file might be  --
--  covered by the GNU Public License.                                      --
--                                                                          --
------------------------------------------------------------------------------
--  [Revision: 1.1]

--  .... This cannot be fully implemented without special support
--  from the implementation of the package Ada.Text_IO.
--  The present version is just a stub.  A true implementation
--  will apparently need to coordinate with
--  the implementation of the standard Ada IO packages, e.g.

--     System.File_Control_Block
--     System.File_IO
--     System.Direct_IO
--     System.Sequential_IO
--     Interfaces.C_Streams

--  The modifications we need to make to those packages will
--  need coordination with ACT.

with Ada.IO_Exceptions,
     Ada.Text_IO,
     POSIX.IO,
     POSIX.Implementation,
     POSIX.Permissions;
package body POSIX.Supplement_to_Ada_IO is

   use POSIX.Implementation;

   function Form_String (Val : Form_Values_for_Open)
      return String is
   begin
      Raise_POSIX_Error (Operation_Not_Supported);
      return "";
   end Form_String;

   function Form_Value (Str : String)
      return Form_Values_for_Open is
      a : Form_Values_for_Open;
   begin
      Raise_POSIX_Error (Operation_Not_Supported);
      return a;
   end Form_Value;

   function Form_String (Val : Form_Values_for_Create)
      return String is
   begin
      Raise_POSIX_Error (Operation_Not_Supported);
      return "";
   end Form_String;

   function Form_Value (Str : String)
      return Form_Values_for_Create is
      a : Form_Values_for_Create;
   begin
      Raise_POSIX_Error (Operation_Not_Supported);
      return a;
   end Form_Value;

   --  .... We may be able to implement Flush_All, using the open file
   --  chain, which is maintained by System.File_IO.

   procedure Flush_All is
   begin
      Raise_POSIX_Error (Operation_Not_Supported);
   end Flush_All;

   procedure Flush_Text_IO (File : in  Ada.Text_IO.File_Type) is
   begin
      Ada.Text_IO.Flush (File);
   end Flush_Text_IO;

   procedure Flush_Sequential_IO is
   begin
      Raise_POSIX_Error (Operation_Not_Supported);
   end Flush_Sequential_IO;

   procedure Flush_Direct_IO is
   begin
      Raise_POSIX_Error (Operation_Not_Supported);
   end Flush_Direct_IO;

end POSIX.Supplement_to_Ada_IO;