; Assembler header file for CDFS
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:43 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 22 June 1995

; OSLib---efficient, type-safe, transparent, extensible,
; register-safe API coverage of RISC OS
; 
; Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
; 
; Licence:
; 
;    OSLib is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 1, or (at your option)
; any later version - and this with the following clarification and
; special exception:
; 
;    Linking this library statically or dynamically with other modules
; is making a combined work based on this library. Thus, the terms
; and conditions of the GNU General Public License cover the whole
; combination.
; 
;    As a special exception, the copyright holders of this library
; give you permission to link this library with independent modules
; to produce an executable, regardless of the license terms of these
; independent modules, and to copy and distribute the resulting
; executable under terms of your choice, provided that you also meet,
; for each linked independent module, the terms and conditions of the
; license of that module. An independent module is a module which is
; not derived from or based on this library. If you modify this
; library, you may extend this exception to your version of the library,
; but you are not obliged to do so. If you do not wish to do so, delete
; this exception statement from your version.
; 
;    OSLib 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
; along with this programme; if not, write to the Free Software
; Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

        [       :LNOT: :DEF: CDFS_Hdr
        GBLS    CDFS_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_FileCore
        GBLS    Get_FileCore
        ]
        [       :LNOT: :DEF: FileCore_Hdr
Get_FileCore                    SETS    "GET oslib/FileCore.Hdr"
        |
Get_FileCore                    SETS    ""
        ]
        $Get_FileCore

;Symbols for constants
CDFS_TruncationFromRight        *       &0
CDFS_TruncationFromLeft         *       &1
CDFS_TruncationNone             *       &2
CDFS_TruncationDefault          *       &FFFFFFFF

;Symbols for structure offsets and sizes
        ^       0
        #       Int
CDFS_TruncationType             *       @


;Symbols for SWI's and SWI reason codes
XCDFS_ConvertDriveToDevice      *       &61E80
CDFS_ConvertDriveToDevice       *       &41E80
   ;Entry
   ;  R0 = log_no (Int)
   ;Exit
   ;  R1 = phys_no (Int)

XCDFS_SetBufferSize             *       &61E81
CDFS_SetBufferSize              *       &41E81
   ;Entry
   ;  R0 = buffer_size_exp (Int)

XCDFS_GetBufferSize             *       &61E82
CDFS_GetBufferSize              *       &41E82
   ;Exit
   ;  R0 = buffer_size_exp (Int)

XCDFS_SetNumberOfDrives         *       &61E83
CDFS_SetNumberOfDrives          *       &41E83
   ;Entry
   ;  R0 = drive_count (Int)

XCDFS_GetNumberOfDrives         *       &61E84
CDFS_GetNumberOfDrives          *       &41E84
   ;Exit
   ;  R0 = drive_count (Int)

XCDFS_GiveFileType              *       &61E85
CDFS_GiveFileType               *       &41E85
   ;Entry
   ;  R0 -> file_name (String)
   ;Exit
   ;  R1 = file_type (Bits)

XCDFS_DescribeDisc              *       &61E86
CDFS_DescribeDisc               *       &41E86
   ;Entry
   ;  R0 = log_no (Int)
   ;  R1 = disc (pointer to FileCore_Disc)

XCDFS_WhereIsFile               *       &61E87
CDFS_WhereIsFile                *       &41E87
   ;Entry
   ;  R0 -> file_name (String)
   ;Exit
   ;  R1 = block_no (Int)
   ;  R2 = size (Int)

XCDFS_Truncation                *       &61E88
CDFS_Truncation                 *       &41E88

CDFSTruncation_Read             *       &0
   ;Entry
   ;  R0 = &0
   ;Exit
   ;  R1 = type (CDFS_TruncationType)

CDFSTruncation_Write            *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = type (CDFS_TruncationType)

        ]
        END
