--------------------------------------------------------------------------------
--                                                                            --
-- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers.               --
--                                                                            --
-- This library is free software; you can redistribute it and/or              --
-- modify it under the terms of the GNU Lesser General Public                 --
-- License as published by the Free Software Foundation; either               --
-- version 2.1 of the License, or (at your option) any later version.         --
--                                                                            --
-- This library 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           --
-- Lesser General Public License for more details.                            --
--                                                                            --
-- You should have received a copy of the GNU Lesser General Public           --
-- License along with this library; if not, write to the Free Software        --
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    --
--                                                                            --
--------------------------------------------------------------------------------

-- @brief Types and subprograms for CD handling through CDFS.
-- $Author$
-- $Date$
-- $Revision$

with RASCAL.Utility;               use RASCAL.Utility;

package RASCAL.CDFS is

   type CDFS_Control_Block_Type is
   record
   Device : Integer;
   Card   : Integer;
   LUN    : Integer;
   Driver : Integer;
   UnDef  : Integer;
   end record;
   pragma Convention (C, CDFS_Control_Block_Type);

   type Disc_Used_Mode_1_Type is
   record
   CD_Size    : Integer;
   Block_Size : Integer;
   end record;
   pragma Convention (C, Disc_Used_Mode_1_Type);

   type Disc_Used_Mode_2_Type is
   record
   CD_ID       : Integer;
   Sector_Size : Integer;
   end record;
   pragma Convention (C, Disc_Used_Mode_2_Type);

   --
   -- The call converts a logical drive number to a physical drive number.
   --You can then use the physical drive number to produce a CDFS control block, which you have to pass when calling CDFSDriver SWIs.
   --The call returns an error if the logical drive is not known.
   --
   function Convert_DriveToDevice (Drive : in Integer) return Integer;

   --
   -- Returns size of CD currently in drive.
   --
   procedure Get_CD_Size (Block         : in out Disc_Used_Mode_1_Type;
                          Control_Block : in out CDFS_Control_Block_Type);

   --
   -- Returns size of CD currently in drive.
   --
   procedure Get_CD_Size (Block         : in out Disc_Used_Mode_2_Type;
                          Control_Block : in out CDFS_Control_Block_Type);


private
end RASCAL.CDFS;