; Assembler header file for FileSwitch
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:44 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 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: FileSwitch_Hdr
        GBLS    FileSwitch_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

;Symbols for constants
Error_FileSwitchNoClaim         *       &400
Error_BadFSControlReason        *       &401
Error_BadOSFileReason           *       &402
Error_BadOSArgsReason           *       &403
Error_BadOSGBPBReason           *       &404
Error_BadModeForOSFind          *       &405
Error_NoRoomForTransient        *       &406
Error_ExecAddrNotInCode         *       &407
Error_ExecAddrTooLow            *       &408
Error_UnknownActionType         *       &409
Error_TooManyLevels             *       &40A
Error_NoSelectedFilingSystem    *       &40B
Error_CantRemoveFSByNumber      *       &40C
Error_UnalignedFSEntry          *       &40D
Error_UnsupportedFSEntry        *       &40E
Error_FSNotSpecial              *       &40F
Error_CoreNotReadable           *       &410
Error_CoreNotWriteable          *       &411
Error_BadBufferSizeForStream    *       &412
Error_NotOpenForReading         *       &413
Error_NotEnoughStackForFSEntry  *       &414
Error_NothingToCopy             *       &415
Error_NothingToDelete           *       &416
Error_FileSwitchCantBeKilledWhilstThreaded *       &417
Error_InvalidErrorBlock         *       &418
Error_FSFileTooBig              *       &419
Error_CantRMFasterFileSwitch    *       &41A
Error_InconsistentHandleSet     *       &41B
Error_IsAFile                   *       &41C
Error_BadFileType               *       &41D
Error_LibrarySomewhereElse      *       &41E
Error_PathIsSelfContradictory   *       &41F
Error_WasntDollarAfterDisc      *       &420
Error_NotEnoughMemoryForWildcardResolution *       &421
Error_NotEnoughStackForWildcardResolution *       &422
Error_DirWantedFileFound        *       &423
Error_NotFound                  *       &424
Error_MultipartPathUsed         *       &425
Error_RecursivePath             *       &426
Error_MultiFSDoesNotSupportGBPB11 *       &427
Error_FileSwitchDataLost        *       &428
Error_TooManyErrorLookups       *       &429
Error_MessageFileBusy           *       &42A
Error_PartitionBusy             *       &42B
FileSwitch_FSNumberNone         *       &0
FileSwitch_FSNumberROMFS        *       &3
FileSwitch_FSNumberNETFS        *       &5
FileSwitch_FSNumberADFS         *       &8
FileSwitch_FSNumberNETPRINT     *       &C
FileSwitch_FSNumberNull         *       &D
FileSwitch_FSNumberPrinter      *       &E
FileSwitch_FSNumberSerial       *       &F
FileSwitch_FSNumberVDU          *       &11
FileSwitch_FSNumberRAWVDU       *       &12
FileSwitch_FSNumberKBD          *       &13
FileSwitch_FSNumberRAWKBD       *       &14
FileSwitch_FSNumberDESKFS       *       &15
FileSwitch_FSNumberRAMFS        *       &17
FileSwitch_FSNumberRISCIXFS     *       &18
FileSwitch_FSNumberStreamer     *       &19
FileSwitch_FSNumberSCSIFS       *       &1A
FileSwitch_FSNumberDigitiser    *       &1B
FileSwitch_FSNumberScanner      *       &1C
FileSwitch_FSNumberMULTIFS      *       &1D
FileSwitch_FSNumberNFS          *       &21
FileSwitch_FSNumberCDFS         *       &25
FileSwitch_FSNumberDOSFS        *       &2B
FileSwitch_FSNumberRESOURCEFS   *       &2E
FileSwitch_FSNumberPIPEFS       *       &2F
FileSwitch_FSNumberDEVICEFS     *       &35
FileSwitch_FSNumberParallel     *       &36
FileSwitch_FSNumberSPARKFS      *       &42
FileSwitch_FSNumberPCCARDFS     *       &59
FileSwitch_FSNumberMEMFS        *       &5B
FileSwitch_FSNumberSHAREFS      *       &63
FileSwitch_FSNumberLANMAN       *       &66
FileSwitch_FSNumberOMNIPRINT    *       &68
FileSwitch_FSNumberRSDFS        *       &6C
FileSwitch_FSNumber             *       &FF
FileSwitch_FSOpenFileLimit      *       &FF00
FileSwitch_FSReadOnly           *       &10000
FileSwitch_HasExtraFlags        *       &20000
FileSwitch_NoFileEntries        *       &40000
FileSwitch_NoSaveEntry          *       &80000
FileSwitch_NoLoadEntry          *       &100000
FileSwitch_ImplicitDirectories  *       &200000
FileSwitch_NeedsURDAndLib       *       &400000
FileSwitch_SupportsImage        *       &800000
FileSwitch_Reserved             *       &1000000
FileSwitch_SupportsFileInfo     *       &2000000
FileSwitch_SupportsStampNamed   *       &4000000
FileSwitch_NeedsFlush           *       &8000000
FileSwitch_NeedsCreate          *       &10000000
FileSwitch_SupportsEmptyNames   *       &20000000
FileSwitch_Interactive          *       &40000000
FileSwitch_SupportsSpecial      *       &80000000
FileSwitch_SupportsDirChange    *       &1
FileSwitch_NeedsCat             *       &2
FileSwitch_NeedsEx              *       &4
FileSwitch_SupportsIOCtl        *       &8
FileSwitch_NotFound             *       &0
FileSwitch_IsFile               *       &1
FileSwitch_IsDir                *       &2
FileSwitch_IsImage              *       &3
FileSwitch_AttrOwnerRead        *       &1
FileSwitch_AttrOwnerWrite       *       &2
FileSwitch_AttrOwnerSpecial     *       &4
FileSwitch_AttrOwnerLocked      *       &8
FileSwitch_AttrWorldRead        *       &10
FileSwitch_AttrWorldWrite       *       &20
FileSwitch_AttrWorldSpecial     *       &40
FileSwitch_AttrWorldLocked      *       &80
Error_NotSupported              *       &F8
Error_FSWriteOnly               *       &FA
Error_FSReadOnly                *       &FC

;Symbols for structure offsets and sizes
        ^       0
        #       Byte
FileSwitch_FSNo                 *       @

        ^       0
        #       Bits
FileSwitch_FSInfo               *       @

        ^       0
        #       Bits
FileSwitch_FSExtraInfo          *       @

        ^       0
        #       Int
FileSwitch_ObjectType           *       @

        ^       0
        #       Bits
FileSwitch_Attr                 *       @

        ^       0
FileSwitch_InfoWords_date_and_time #       OS_DateAndTime
        ^       0
FileSwitch_InfoWords_addrs_exec_addr #       Bits
FileSwitch_InfoWords_addrs_load_addr #       Bits
FileSwitch_InfoWords            *       @


;Symbols for SWI's and SWI reason codes
BGetV                           *       &A
   ;Entry
   ;  R1 = file (OS_F)
   ;  R9 = &A
   ;Exit
   ;  R0 = c (Char)

BGetVW                          *       &A
   ;Entry
   ;  R1 = file (OS_FW)
   ;  R9 = &A
   ;Exit
   ;  R0 = c (Char)

BPutV                           *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_F)
   ;  R9 = &B

BPutVW                          *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_FW)
   ;  R9 = &B

XOS_BGet                        *       &2000A
OS_BGet                         *       &A
   ;Entry
   ;  R1 = file (OS_F)
   ;Exit
   ;  R0 = c (Char)

XOS_BGetW                       *       &2000A
OS_BGetW                        *       &A
   ;Entry
   ;  R1 = file (OS_FW)
   ;Exit
   ;  R0 = c (Char)

XOS_BPut                        *       &2000B
OS_BPut                         *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_F)

XOS_BPutW                       *       &2000B
OS_BPutW                        *       &B
   ;Entry
   ;  R0 = c (Char)
   ;  R1 = file (OS_FW)

Service_StartUpFS               *       &12
   ;Entry
   ;  R1 = &12
   ;  R2 = fs_no (FileSwitch_FSNo)

Service_FSRedeclare             *       &40
   ;Entry
   ;  R1 = &40

Service_CloseFile               *       &68
   ;Entry
   ;  R1 = &68
   ;  R2 -> file_name (String)
   ;  R3 = count (Int)
   ;Exit
   ;  R3 = count_out (Int)

Service_UKCompression           *       &B7

Service_UKCompressionUnsqueeze  *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 = &B7
   ;  R2 = load_addr (Bits)
   ;  R3 = size (Int)
   ;  R4 = exec_addr (Bits)
   ;  R5 -> filename (String)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R3 = size_out (Int)
   ;  R4 = new_exec_addr (Bits)

Service_UKCompressionPatch      *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = &B7
   ;  R2 = load_addr (Bits)
   ;  R3 = size (Int)
   ;  R4 = exec_addr (Bits)
   ;  R5 -> filename (String)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R3 = size_out (Int)
   ;  R4 = new_exec_addr (Bits)

Service_UKCompressionNonAIF     *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = &B7
   ;  R2 = &8000
   ;  R3 = size (Int)
   ;  R4 = exec_addr (Bits)
   ;  R5 -> filename (String)
   ;  R6 -> header (data)
   ;  R7 -> args (String)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R3 = size_out (Int)
   ;  R4 = new_exec_addr (Bits)

Service_UKCompression26BitOn32Bit *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = &B7
   ;  R2 = &8000
   ;  R3 = size (Int)
   ;  R4 = exec_addr (Bits)
   ;  R5 -> filename (String)
   ;  R6 -> header (data)
   ;  R7 -> args (String)
   ;Exit
   ;  R1 = unclaimed (Bool)
   ;  R3 = size_out (Int)
   ;  R4 = new_exec_addr (Bits)

Service_UKCompressionDebugger   *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 = &B7
   ;  R2 = &8000
   ;  R3 = size (Int)
   ;  R4 = exec_addr (Bits)
   ;  R5 -> filename (String)
   ;Exit
   ;  R1 = unclaimed (Bool)

        ]
        END
