        SUBT    High level Filing System interface. => &.Hdr.File
OldOpt  SETA    {OPT}
        OPT     OptNoList+OptNoP1List

; ***********************************
; ***    C h a n g e   L i s t    ***
; ***********************************

; Date       Name  Description
; ----       ----  -----------
; 12-Oct-87  SKS   Add OSGBPB_ReadDirEntriesCatInfo
; 06-Nov-87  SKS   Add offsets in ReadDirEntriesInfo
; 28-Jan-88  SKS   Add cc_rfs number
; 08-Feb-88  SKS   Add FSControl_FileTypeFromString
; 01-Mar-88  SKS   Add ramfs number
; 24-Mar-88  SKS   Add FSControl_FileInfo
; 25-Mar-88  SKS   Add FSControl_ReadFSName
; 26-May-88  SKS   Add FSControl_SetContexts
; 04-Jun-88  SKS   Add OSFile_MakeError
; 03-Aug-88  SKS   Add unixfs number
; 15-Sep-88  SKS   Add digitape_number
; 25-Jan-89 NReeves Add scsifs_number
; 20-Feb-89  APT   Correct UnixFS name
; 24-Feb-89  BC    Add TVFS filing system number
; 09-Mar-89  BC    Add ScanFS filing system number
; 20-Mar-89  BC    Add MultiFS filing system number for JSmith
; 05-Jun-89  BC    Added fsnumber_Fax for Computer Concepts Fax Pack
; 14-Jul-89  TMD   Added fsnumber_Z88 for Colton Software
; 18-Jul-89  BC    Added fsnumber_SCSIDeskFS for JB  
; 02-Aug-89  JSR   Added fsnumber_NFS
; 08-Aug-89  BC    Added fsnumber_Serial2 for The Soft Option
; 09-Aug-89 NRaine Removed deviant extra definition of fsnumber_Serial2
; 15-Aug-89  BC    Allocated fsnumber_dfs (4) to PRES
; 21-Aug-89  BC    Allocated fsnumber_DFSDeskFS (35) to PRES, deallocated 4
; 07-Sep-89 NRaine Allocated fsnumber_dayibmfs (36) to Daylight Software
; 02-Oct-89  BC    Allocated fsnumber_CDFS (37) to Next Technology
; 10-Nov-89 NRaine Allocated fsnumber_BBScanFS to David Spencer (Beebug)
; 10-Nov-89  BC    Allocated fsnumber_loader (41) for DSL/Acorn broadcast loader
; 05-Jan-90  WS    Allocated fsnumber_chunkfs (42) for Computer Concepts
; 29-Jan-90  BC    Allocated fsnumber_MSDOSFS (43) primarily for Minerva
; 29-Jan-90  BC    Allocated fsnumber_NoRiscFS (44) for Minerva
; 20-Feb-90  BC    Allocated fsnumber_Nexus (45) for SJ Research
; 22-Feb-90 NRaine Allocated fsnumber_resourcefs (46) for "Resources:"
; 27-Apr-90 NRaine Allocated fsnumber_pipefs (47) for "Pipe:"
; 08-May-90  BC    Allocated fsnumber_NexusFilerFS (48) for SJ Research
; 08-May-90  BC    Re-Structured filing system number allocations
; 12-Jun-90  BC    Allocated fsnumber_IDEFS (49) for Sefan Frhling
; 11-Jul-90  BC    Allocated fsnumber_CCPrintFS (50) for Computer Concepts
; 17-Jul-90  BC    Allocated fsnumber_BrainsoftVFS (51) for Brainsoft
; 17-Jul-90  BC    Allocated fsnumber_BrainsoftSFS (52) for Brainsoft
; 13-Sep-90  BC    Changed lfs: to pc: (38) for Computer Concepts
; 14-Sep-90 JRoach Added several OS_FSControls:
;                       FSControl_RegisterImageFS (35)
;                       FSControl_DeRegisterImageFS (36)
;                       FSControl_CanonicalisePath (37)
;                       FSControl_InfoToFileType (38)
;                  Added this OS_Args:
;                       OSArgs_ReadPath (7)
;                  Added these OS_Files:
;                       OSFile_ReadWithType (20)
;                       OSFile_ReadWithTypePath (21)
;                       OSFile_ReadWithTypePathVar (22)
;                       OSFile_ReadWithTypeNoPath (23)
;                  Added this OS_GBPB:
;                       OSGBPB_ReadDirEntriesFileType (12)
; 19-Oct-90 JRoach Added a couple of OS_FSControls:
;                       FSControl_URD (39)
;                       FSControl_Back (40)
; 22-Nov-90 JRoach Added a couple of OS_FSControls:
;                       FSControl_DefectList (41)
;                       FSControl_AddDefect (42)
;
; 18-Dec-90  DDV   Allocate fsnumber_DevicesFS (53) for "Devices:" (Acorn)
;            DDV   Allocate fsnumber_ParallelFS (54) for "parallel:" (Acorn)
; 11-Jan-91  BC    Allocate fsnumber_VCMNetFS (55) for VCM-Net, David Miller
; 11-Jan-91  BC    Allocate fsnumber_ArcFS (56) M. Smith (came via CS)
; 20-Jan-91  JSR   Added FSControl_NoDir, _NoURD and _NoLib (43-45)
; 19-Feb-91  BC    Allocate fsnumber_NexusPrintFS (57) for SJ Research
; 26-Feb-91  JAB   Allocated fsnumber_AtomWidePIA (58) for Atomwide
; 04-Mar-91  BC    Allocated fsnumber_RSDosFS (59) for Rob Schrauwen (came via CS)
; 15-Mar-91  JSR   Add OSFile_ReadBlockSize
;                      FSControl_UsedSpaceMap
;                      FSControl_ReadBootOption
;                      FSControl_WriteBootOption
; 09-Apr-91  JSR   Add FSControl_ReadFreeSpace (49)
; 26-Apr-91  JSR   Add FSControl_NameDisc (50)
; 29-Apr-91  JSR   Add FSControl_StampImage (51)
;                      OSArgs_ImageStampIs (8)
; 09-May-91  JSR   Add FSControl_ObjectAtOffset (52)
; 19-Jun-91  JAB   Allocated fsnumner_SimtrondbFS for Simtron (60)
; 01-Jul-91  BC    Allocated fsnumber_PSCompressFS
; 18-Jul-91  JAB   Allocated fsnumber_DabsArcDFS (61)
; 02-Aug-91  JAB   Allocated fsnumber_DTSoftPCCFS (63)
; 07-Aug-91 JRoach Added FSControl_SetDir (53)
; 15-Aug-91  AMG   Allocated fsnumber_RAMJetFS (64) (Cust Svc ref 3619)
; 02-Sep-91 JRoach Allocated fsnumber_MenonFS (&79)
; 12-Sep-91 JRoach Added FSControl_ReadDir
; 13-Sep-91  AMG   Changed RAMJetFS to RAMJtFS at author's request (64)
; 09-Jan-92  JAB   Added fsnumber_JBPShareFS (65)
; 23-Jan-92  amg   Added comment for OSFile 36
; 17-Feb-92  JAB   Added fsnumber_DPSparkFS (66)
; 17-Feb-92  JAB   Added fsnumber_ArxeQuadFS (67)
; 09-Apr-92  JAB   Added fsnumber_SPFLOPFS (68)
; 09-Apr-92  JAB   Added fsnumber_AOZBootFS (69)
; 09-Apr-92  JAB   Added fsnumber_AOZCardFS (70)
; 09-Apr-92  JAB   Added fsnumber_AOZISCSFS (71)
; 15-Apr-92  JSR   Added fsnumber_SPSTFS (128) for Lingenuity's Snapshot board
; 12-Jun-92  JAB   Added fsnumber_LindisTempFS (73) for Lindis temp filing system
; 27-Jul-92  JAB   Added fsnumber_DTSRAMFS (74) for DT Software static RAM fs
; 21-Aug-92  JAB   Added fsnumber_PsionFS (75) for Computer Concepts
; 02-Sep-92  JAB   Added fsnumber_RemoteFS (76) for Atomide
; 04-Sep-92  PJC   Added fsnumber_MirrorFS (77)
; 08-Sep-92  JAB   Added fsnumber_LinkFS (78) for MicroTest (for CS)
; 04-Nov-92  RM    Added fsnumber_FTPFS  (79)

;
; Filing System numbers - the definitive list
; ===========================================
;
                        ^       0
fsnumber_none           # 1     ;   0                   No fs selected (valid state)
fsnumber_tape1200       # 1     ;   1                   Not supported
fsnumber_tape300        # 1     ;   2                   Not supported
fsnumber_rom            # 1     ;   3 Rom:              Acorn
fsnumber_dfs            # 1     ;   4                   Not supported
fsnumber_net            # 1     ;   5 Net:              Acorn
fsnumber_telesoft       # 1     ;   6                   Not supported
fsnumber_IEEE           # 1     ;   7                   Not supported
fsnumber_adfs           # 1     ;   8 Adfs:             Acorn
fsnumber_reserved       # 1     ;   9                   Reserved for compatability with the BBC world
fsnumber_vfs            # 1     ;  10                   Not supported
fsnumber_wdfs           # 1     ;  11 BBC:              Acorn, reused so that Modula2 works
fsnumber_netprint       # 1     ;  12 NetPrint:         Acorn
fsnumber_null           # 1     ;  13 Null:             Acorn
fsnumber_printer        # 1     ;  14 Printer:          Acorn
fsnumber_serial         # 1     ;  15 Serial:           Acorn
fsnumber_acacia_ramfs   # 1     ;  16
fsnumber_vdu            # 1     ;  17 Vdu:              Acorn
fsnumber_rawvdu         # 1     ;  18 RawVdu:           Acorn
fsnumber_kbd            # 1     ;  19 Kbd:              Acorn
fsnumber_rawkbd         # 1     ;  20 RawKbd:           Acorn
fsnumber_deskfs         # 1     ;  21 DeskFS:           Acorn
fsnumber_cc_rfs         # 1     ;  22 rfs:              Computer Concepts ROM board
fsnumber_ramfs          # 1     ;  23 RAM:              Acorn
fsnumber_RISCiXFS       # 1     ;  24 RISCiXFS:         Acorn 
fsnumber_digitape       # 1     ;  25 DigiTape:         Digital Services Tape Streamer
fsnumber_SCSIFS         # 1     ;  26 SCSI:             Acorn
fsnumber_TVFS           # 1     ;  27 TVFS:             Mike Harrison's digitiser filing system
fsnumber_ScanFS         # 1     ;  28 ScanFS:           Mike Harrison's scanner (Watford)
fsnumber_MultiFS        # 1     ;  29 MultiFS:          Jamie Smith's multi-format FS
fsnumber_Fax            # 1     ;  30 fax:              Computer Concepts Fax Pack
fsnumber_Z88            # 1     ;  31 Z88:              Colton Software Z88 filing system
fsnumber_SCSIDeskFS     # 1     ;  32 SCSIDeskFS:       John Balance Software
fsnumber_NFS            # 1     ;  33 NFS:              Acorn
fsnumber_Serial2        # 1     ;  34 Serial2:          The Soft Option
fsnumber_DFSDeskFS      # 1     ;  35 DFSDeskFS:        PRES
fsnumber_dayibmfs       # 1     ;  36 DayIBMFS:         Daylight Software IBM filing system
fsnumber_CDFS           # 1     ;  37 CDFS:             Next Technology
fsnumber_RISCardfs      # 1     ;  38 pc:               Computer Concepts
fsnumber_pcfs           # 1     ;  39 pcfs:             Computer Concepts
fsnumber_BBScanFS       # 1     ;  40 BBScanFS:         Beebug
fsnumber_loader         # 1     ;  41 BroadcastLoaderUtils: Acorn & Digital Services broadcast loader
fsnumber_chunkfs        # 1     ;  42 chunkfs:          Computer Concepts
fsnumber_MSDOSFS        # 1     ;  43 MSDOS:            MultiFS, Minerva, Public
fsnumber_NoRiscFS       # 1     ;  44 NoRiscFS:         Minerva
fsnumber_Nexus          # 1     ;  45 Nexus:            SJ Research
fsnumber_resourcefs     # 1     ;  46 Resources:        Acorn
fsnumber_pipefs         # 1     ;  47 Pipe:             Acorn
fsnumber_NexusFilerFS   # 1     ;  48 NexusFilerFS:     SJ Research
fsnumber_IDEFS          # 1     ;  49 IDEFS:            Sefan Frhling
fsnumber_CCPrintFS      # 1     ;  50 PrintFS:          Computer Concepts
fsnumber_BrainsoftVFS   # 1     ;  51 VideoDigitiserFS: Brainsoft
fsnumber_BrainsoftSFS   # 1     ;  52 SoundDigitiserFS: Brainsoft
fsnumber_DeviceFS       # 1     ;  53 Devices:          Acorn 
fsnumber_ParallelFS     # 1     ;  54 Parallel:         Acorn
fsnumber_VCMNetFS       # 1     ;  55 Vcmn:             VCM-Net, David Miller
fsnumber_ArcFS          # 1     ;  56 ArcFS:            M. Smith
fsnumber_NexusPrintFS   # 1     ;  57 NexusPrintFS:     Tony Engeham, SJ Research
fsnumber_AtomWide       # 1     ;  58 PIA:              Martin Coulson, Atomwide
fsnumber_RSDosFS        # 1     ;  59 rsdos:            Rob Schrauwen, via CS
fsnumber_SimtrondbFS    # 1     ;  60 dbFS:             Simon Wright, Simtron
fsnumber_PSCompressFS   # 1     ;  61 PSCompress:       Acorn
fsnumber_DabsArcDFS     # 1     ;  62 DFS:              Richard Averill, Dabs Press
fsnumber_DTSoftPCCFS    # 1     ;  63 PCCFS:            David Knell, DT Software                                                                    
fsnumber_RAMJetFS       # 1     ;  64 RAMJtFS:          Martin Dorey (CS 3619)
fsnumber_JBPShareFS     # 1     ;  65 PShareFS          John Ballance, JB Computing
fsnumber_DPSparkFS      # 1     ;  66 SparkFS:          David Pilling
fsnumber_ArxeQuadFS     # 1     ;  67 QuadFS:           Onkar Jagpal, Arxe
fsnumber_SPFLOPFS       # 1     ;  68 FLOPFS:           Hugo, Serial Port
fsnumber_AOZBootFS      # 1     ;  69 BootFS:           Acorn OZ for CCC
fsnumber_AOZCardFS      # 1     ;  70 CardFS:           Acorn OZ for InterTech
fsnumber_AOZISCSFS      # 1     ;  71 ISCSFS:           Acorn OZ for Alan Williams
fsnumber_PFS            # 1     ;  72 PFS:              Portable FS
fsnumber_LindisTempFS   # 1     ;  73 TempFS:           Lindis Temp filing system
fsnumber_DTSRAMFS       # 1     ;  74 SRAMFS:           DT Software static RAM fs
fsnumber_PsionFS        # 1     ;  75 PsionFS:          Alex Bligh, Computer Concepts
fsnumber_RemoteFS       # 1     ;  76 RemoteFS:         Nicko for Atomwide
fsnumber_MirrorFS       # 1     ;  77 MirrorFS:         Acorn
fsnumber_LinkFS         # 1     ;  78 LinkFS:           Lee Davies, MicroTest (for CS)
fsnumber_FTPFS          # 1     ;  79 FTP:              Acorn

fsnumber_MenonFS        * &79   ;  121 MenonFS:         Joris Rling
fsnumber_SPSTFS         * &80   ;  128 SPSTFS:          Lingenuity's Snapshot board

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Reason codes in r0b for OSFile
; ==============================

OSFile_Load             *       &FF     ; Uses File$Path
OSFile_Save             *       0
OSFile_WriteInfo        *       1
OSFile_WriteLoad        *       2
OSFile_WriteExec        *       3
OSFile_WriteAttr        *       4
OSFile_ReadInfo         *       5       ; Uses File$Path
OSFile_Delete           *       6
OSFile_Create           *       7
OSFile_CreateDir        *       8
OSFile_SetStamp         *       9       ; These ops don't get passed to a Filing System
OSFile_SaveStamp        *       10
OSFile_CreateStamp      *       11
OSFile_LoadPath         *       12      ; Uses given path
OSFile_ReadPath         *       13      ; Uses given path
OSFile_LoadPathVar      *       14      ; Uses given path variable
OSFile_ReadPathVar      *       15      ; Uses given path variable
OSFile_LoadNoPath       *       16      ; No nonsense load
OSFile_ReadNoPath       *       17      ; No nonsense read
OSFile_SetType          *       18
OSFile_MakeError        *       19

; OS_Files introduced in 1.70 FileSwitch
OSFile_ReadWithType     *       20      ; Uses File$Path
OSFile_ReadWithTypePath *       21      ; Uses supplied path
OSFile_ReadWithTypePathVar *    22      ; Uses supplied path var
OSFile_ReadWithTypeNoPath *     23      ; Uses no path
OSFile_ReadBlockSize    *       24      ; natural block size of a file
                                              
; Skip 36 when we get there. It is used by a virus which relies on getting
; VS back when it's not active, and VC when it is.

load_at_given   *       0       ; Load at address given in r2
load_at_own     *       -1      ; Load at file's own address


; Object type (r0 in OSFile)

object_nothing   *      0
object_file      *      1
object_directory *      2


; Attribute bits (r5 in OSFile)

read_attribute          *       1 :SHL: 0
write_attribute         *       1 :SHL: 1
locked_attribute        *       1 :SHL: 3
public_read_attribute   *       1 :SHL: 4
public_write_attribute  *       1 :SHL: 5


; Reason codes in r0 for FSControl
; ================================

                                        ^ 0
FSControl_Dir                           # 1 ; 0
FSControl_Lib                           # 1 ; 1
FSControl_StartApplication              # 1 ; 2
FSControl_RunType                       # 1 ; 3
FSControl_Run                           # 1 ; 4
FSControl_Cat                           # 1 ; 5
FSControl_Ex                            # 1 ; 6
FSControl_LCat                          # 1 ; 7
FSControl_LEx                           # 1 ; 8
FSControl_Info                          # 1 ; 9
FSControl_Opt                           # 1 ; 10
FSControl_StarMinus                     # 1 ; 11 - Was LIBFS run on PRB

FSControl_AddFS                         # 1 ; 12 - Really new functions begin here
FSControl_LookupFS                      # 1 ; 13
FSControl_SelectFS                      # 1 ; 14
FSControl_BootupFS                      # 1 ; 15
FSControl_RemoveFS                      # 1 ; 16
FSControl_AddSecondaryFS                # 1 ; 17
FSControl_ReadFileType                  # 1 ; 18
FSControl_RestoreCurrent                # 1 ; 19
FSControl_ReadModuleBase                # 1 ; 20
FSControl_ReadFSHandle                  # 1 ; 21
FSControl_Shut                          # 1 ; 22
FSControl_ShutDown                      # 1 ; 23
FSControl_Access                        # 1 ; 24
FSControl_Rename                        # 1 ; 25
FSControl_Copy                          # 1 ; 26
FSControl_Wipe                          # 1 ; 27
FSControl_Count                         # 1 ; 28
FSControl_CreateHandle                  # 1 ; 29
FSControl_ReadSecondaryModuleBase       # 1 ; 30
FSControl_FileTypeFromString            # 1 ; 31
FSControl_FileInfo                      # 1 ; 32
FSControl_ReadFSName                    # 1 ; 33
FSControl_SetContexts                   # 1 ; 34

FSControl_RegisterImageFS               # 1 ; 35 - Functions introduced post Risc OS 2.00 start here
FSControl_DeRegisterImageFS             # 1 ; 36
FSControl_CanonicalisePath              # 1 ; 37
FSControl_InfoToFileType                # 1 ; 38
FSControl_URD                           # 1 ; 39
FSControl_Back                          # 1 ; 40
FSControl_DefectList                    # 1 ; 41
FSControl_AddDefect                     # 1 ; 42
FSControl_NoDir                         # 1 ; 43
FSControl_NoURD                         # 1 ; 44
FSControl_NoLib                         # 1 ; 45
FSControl_UsedSpaceMap                  # 1 ; 46
FSControl_ReadBootOption                # 1 ; 47
FSControl_WriteBootOption               # 1 ; 48
FSControl_ReadFreeSpace                 # 1 ; 49
FSControl_NameDisc                      # 1 ; 50
FSControl_StampImage                    # 1 ; 51
FSControl_ObjectAtOffset                # 1 ; 52
FSControl_SetDir                        # 1 ; 53
FSControl_ReadDir                       # 1 ; 54

; Aliases (to be removed)

FSControl_OPT                * FSControl_Opt       
FSControl_RUN                * FSControl_Run
FSControl_CAT                * FSControl_Cat
FSControl_SHUT               * FSControl_Shut

; Sub-reasons to FSControl_StampImage
FSControl_StampImage_NextUpdate *       0
FSControl_StampImage_Now        *       1

; Directory types for FSControl_SetDir
Dir_Current     * 0
Dir_Previous    * 1
Dir_UserRoot    * 2
Dir_Library     * 3

; Some useful reason codes in r0b for OSFind
; ==========================================

OSFind_OpenIn   *       open_read
OSFind_OpenOut  *       open_write
OSFind_OpenUp   *       open_update

OSFind_ReadFile *       open_read :OR: open_mustopen :OR: open_nodir


; Bits in r0b (open mode) for OSFind
; ==================================

open_write      *       2_10000000
open_read       *       2_01000000
open_update     *       open_write :OR: open_read

open_mustopen   *       2_00001000      ; Always give error if not found
open_nodir      *       2_00000100      ; Always give error if is a dir

open_default    *       2_00000000      ; Use File$Path
open_pathstring *       2_00000001      ; Use supplied path string
open_pathvar    *       2_00000010      ; Use supplied path variable
open_nopath     *       2_00000011      ; Don't use any path for lookup
open_pathbits   *       2_00000011

open_unused     *       2_00110000      ; Will give 'Bad Mode' error if used


; Reason codes in r0b for OSArgs stream operations
; ================================================

OSArgs_ReadPTR  *       0
OSArgs_SetPTR   *       1
OSArgs_ReadEXT  *       2
OSArgs_SetEXT   *       3
OSArgs_ReadSize *       4       ; New function. Maybe combine with ReadInfo ?
OSArgs_EOFCheck *       5       ; New function. Replaces FSCV(1) call
OSArgs_EnsureSize *     6       ; New function

OSArgs_ReadPath *       7       ; Function introduced in 1.70 FileSwitch
OSArgs_ImageStampIs *   8       ; Function introduced in 1.80 FileSwitch

OSArgs_ReadInfo *       &FE     ; New function
OSArgs_Flush    *       &FF


; Reason codes in r0b for OSGBPB
; ==============================

                        ^ 1     ; Perverse, eh ?

OSGBPB_WriteAtGiven     # 1 ; 1
OSGBPB_WriteAtPTR       # 1 ; 2
OSGBPB_ReadFromGiven    # 1 ; 3
OSGBPB_ReadFromPTR      # 1 ; 4

OSGBPB_ReadDiscName     # 1 ; 5
OSGBPB_ReadCSDName      # 1 ; 6
OSGBPB_ReadLIBName      # 1 ; 7
OSGBPB_ReadCSDEntries   # 1 ; 8

OSGBPB_ReadDirEntries   # 1 ; 9
OSGBPB_ReadDirEntriesInfo # 1 ; 10
OSGBPB_ReadDirEntriesCatInfo # 1 ; 11

; These introduced in FileSwitch 1.70:
OSGBPB_ReadDirEntriesFileType # 1 ; 12


                ^       0
RDE_load        #       4
RDE_exec        #       4
RDE_length      #       4
RDE_attr        #       4
RDE_type        #       4
RDE_name        #       0


; File type definitions (real defs in Documents.Allocation.DateDoc)
; =====================

Absolute_LoadAddr  * &FFFFF800
Sprite_LoadAddr    * &FFFFF900
BASIC_LoadAddr     * &FFFFFB00
Transient_LoadAddr * &FFFFFC00
Data_LoadAddr      * &FFFFFD00
Command_LoadAddr   * &FFFFFE00
Text_LoadAddr      * &FFFFFF00

EOF_char * &FE                  ; Unfortunately, &1FE isn't an immediate value

        OPT     OldOpt
        END
