        SUBT    Low level Filing System interfaces => &.Hdr.LowFSi

OldOpt  SETA    {OPT}
        OPT     OptNoList+OptNoP1List

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

; Date       Name  Description
; ----       ----  -----------
; 03-Mar-88  SKS   Add fsinfo_flushnotify
; 08-Mar-88  SKS   Add fsinfo_fsfilereadinfonolen, fsfile_ReadInfoNoLen
; 18-Mar-88  BC    Add fsfunc_FileInfo
; 21-Apr-88  SKS   Add fsinfo_fileinfo
; 13-Jul-88  SKS   Add fsinfo_nfiles, removed pre 1-20 mods
; 09-Oct-89  BC    Add fsfunc_LastFileClosed
; 01-Nov-89  BC    Remove fsfunc_LastFileClosed
;  4-Dec-89  NDR   Add fsinfo_readonly
; 16-Jul-90  JSR   Add fsinfo_multifsextensions
; 03-Sep-90  JSR   Add fsfunc_NewImage, fsfunc_ImageClosing values.
; 22-Oct-90  JSR   Add IFS_... structure, fsinfo_handlesurdetc,
;                       fsinfo_nodirectories
; 25-Oct-90  JSR   Add fsinfo_dontuseload
; 22-Nov-90  JSR   Add fsfunc_DefectList and fsfunc_AddDefect
; 15-Mar-91  JSR   Add fsfile_ReadBlockSize
;                      fsfunc_ReadBootOption
;                      fsfunc_WriteBootOption
; 21-Mar-91  JSR   Add fsfunc_UsedSpaceMap
; 09-Apr-91  JSR   Add fsfunc_ReadFreeSpace
; 26-Apr-91  JSR   Add fsfunc_NameDisc
; 29-Apr-91  JSR   Add fsfunc_StampImage
;                      fsargs_ImageStampIs
; 09-May-91  JSR   Add fsfunc_ObjectAtOffset
; 12-Jul-91  JSR   Add fsinfo_dontusesave
;                      fsinfo_giveaccessstring
;                      fsinfo_extrainfo
;                      fsextra_dirinformation
;                      fsfunc_DirIs
; 22-Jul-91  JSR   Update FSHeader macro to handle extrainfo
; 07-Aug-91  JSR   Add fsextra_FSDoesCat
;                      fsextra_FSDoesEx
; 16-Sep-91  BC    Added symbols for calculating the fsinfo word
; 03-Nov-94  amg   Add fsfunc_ReadFreeSpace64
; 09-Nov-94  amg   Add fsfunc_DefectList64, fsfunc_AddDefect64
; 02-Nov-95  MFC   Add Max_BuffSize

        MACRO
$label  FSHeader $info, $extrainfo
$label._FSInfoBlock
        DCD     $label._Name        -$label._ModuleBase
        DCD     $label._StartupText -$label._ModuleBase
        DCD     $label._Open        -$label._ModuleBase
        DCD     $label._Get         -$label._ModuleBase
        DCD     $label._Put         -$label._ModuleBase
        DCD     $label._Args        -$label._ModuleBase
        DCD     $label._Close       -$label._ModuleBase
        DCD     $label._File        -$label._ModuleBase
        DCD     $info
        DCD     $label._Func        -$label._ModuleBase
        DCD     $label._GBPB        -$label._ModuleBase
 [ "$extrainfo"=""
 ASSERT (.-$label._FSInfoBlock) = FS_size - 4
 |
        DCD     $extrainfo
 ASSERT (.-$label._FSInfoBlock) = FS_size
 ]
        MEND


; The variable Max_BuffSize determines the maximum permitted value for the
;  "natural block size" returned by a Filing System to FileSwitch when
;  FSEntry_Open is called.
;
; In versions of FileSwitch prior to 2.28, this was hard-coded as 1024.
;
; The value must be a power of 2, and is set to 2048 in 2.28. This is of
;  considerable benefit to CDFS, since the sector size on CD-ROMs is
;  2048 bytes.
;
; If any value other than 1024 or 2048 is chosen, code in s.OSFind will also
;  need to be changed (search for Max_BuffSize and it's obvious).
 
Max_BuffSize   *   2048


; Offsets from start of FS information block in a FS module

         ^      0
FS_name  #      4
FS_startuptext # 4
FS_open  #      4 ; --\
FS_get   #      4 ;   |
FS_put   #      4 ;   } Module offsets in same order and offset as fscb_xxx
FS_args  #      4 ;   |
FS_close #      4 ;   |
FS_file  #      4 ; --/
FS_info  #      4
FS_func  #      4 ; --\
FS_gbpb  #      4 ; --/ For fast unbuffered gbpb
FS_extra #      4 ; extra information word
FS_size  *      @-FS_name

; Bits in FS_info

fsinfo_special          * 1 :SHL: 31
fsinfo_notpermanent     * 1 :SHL: 30
fsinfo_nullnameok       * 1 :SHL: 29
fsinfo_alwaysopen       * 1 :SHL: 28    ; Try to open regardless of file exist
fsinfo_flushnotify      * 1 :SHL: 27    ; Tell filing system when flushing
fsinfo_fsfilereadinfonolen * 1 :SHL: 26 ; fsfile_ReadInfoNoLen supported
fsinfo_fileinfo         * 1 :SHL: 25    ; fsfunc_FileInfo supported
fsinfo_setcontexts      * 1 :SHL: 24    ; fsfunc_SetContexts supported
fsinfo_multifsextensions * 1:SHL: 23    ; Calls introduced for MultiFS supported:
                                        ; fsfunc_CanonicaliseSpecialAndDisc
                                        ; fsfunc_ResolveWildcard
fsinfo_handlesurdetc    * 1 :SHL: 22    ; This FS must handle & and % itself, so pass
                                        ; these through please, FileSwitch.
fsinfo_nodirectories    * 1 :SHL: 21    ; Don't store directories for this FS in system
                                        ; variables. When pressed FileSwitch will plug
                                        ; in the default values for the directories.
fsinfo_dontuseload      * 1 :SHL: 20    ; Don't use fsfile_Load, but openin, gbgp, close
                                        ; instead
fsinfo_dontusesave      * 1 :SHL: 19    ; Don't use fsfile_Save, but create, openup, gbgp, close
                                        ; instead
fsinfo_giveaccessstring * 1 :SHL: 18    ; On a *access use the access entry point quoting the
                                        ; access string. If this bit is clear OS_File will be
                                        ; used instead, with the access string having been parsed
                                        ; by FileSwitch
fsinfo_extrainfo        * 1 :SHL: 17    ; FS_extra present

fsinfo_readonly         * 1 :SHL: 16    ; filing system is read-only

fsinfo_nfiles_shift     * 8
fsinfo_nfiles           * &FF :SHL: fsinfo_nfiles_shift
                                        ; Min number of files openable on fs
                                        ; 0 -> unlimited by fs
fsinfo_number_shift     * 0
fsinfo_number           * &FF :SHL: fsinfo_number_shift

fsinfo_notforMultiFS    * :NOT: fsinfo_flushnotify      ; Anything other than flushnotify is going to upset a MultiFS

; Bits in FS_extra
fsextra_dirinformation  * 1 :SHL: 0     ; filing system supports fsfunc_DirIs
fsextra_FSDoesCat       * 1 :SHL: 1     ; filing system does Cat rather than FileSwitch
fsextra_FSDoesEx        * 1 :SHL: 2     ; filing system does Ex rather than FileSwitch
; bits 3-31 unused (yet)

; Offsets from start of IFS information block in a IFS (MultiFS) module

                ^       0
IFS_info        #       4
IFS_filetype    #       4
IFS_open        #       4
IFS_get         #       4
IFS_put         #       4
IFS_args        #       4
IFS_close       #       4
IFS_file        #       4
IFS_func        #       4
IFS_size        *       @-IFS_info

; Reason codes passed to fscb^.File

fsfile_Load          *  &FF
fsfile_Save          *  0
fsfile_WriteInfo     *  1
fsfile_WriteLoad     *  2
fsfile_WriteExec     *  3
fsfile_WriteAttr     *  4
fsfile_ReadInfo      *  5
fsfile_Delete        *  6
fsfile_Create        *  7
fsfile_CreateDir     *  8
fsfile_ReadInfoNoLen *  9
fsfile_ReadBlockSize *  10


; Reason codes passed to fscb^.Open

                    ^ 0
fsopen_ReadOnly     # 1
fsopen_CreateUpdate # 1
fsopen_Update       # 1


; Bits in r0 passed back from fscb^.Open

fsopen_WritePermission  * 1 :SHL: 31
fsopen_ReadPermission   * 1 :SHL: 30
fsopen_IsDirectory      * 1 :SHL: 29
fsopen_UnbufferedGBPB   * 1 :SHL: 28
fsopen_Interactive      * 1 :SHL: 27
fsopen_DeviceIdentity   * &FFFFFFFF :SHR: (32-27)


; Reason codes passed to fscb^.Args

                        ^ 0
fsargs_ReadPTR          # 1     ; ARGS 0        0  Only unbuffered fs
fsargs_SetPTR           # 1     ; ARGS 1        1  Only unbuffered fs
fsargs_ReadEXT          # 1     ; ARGS 2        2  Only unbuffered fs
fsargs_SetEXT           # 1     ; ARGS 3        3  All fs
fsargs_ReadSize         # 1     ; ARGS 4        4  Only unbuffered fs
fsargs_EOFCheck         # 1     ; ARGS 5        5  Only unbuffered fs
fsargs_Flush            # 1     ; ARGS 255      6  Only unbuffered fs (or Nick)
fsargs_EnsureSize       # 1     ; ARGS 6        7  All fs
fsargs_WriteZeroes      # 1     ; internal      8  Only buffered fs
fsargs_ReadLoadExec     # 1     ; internal      9  All fs
fsargs_ImageStampIs     # 1     ; ARGS 8        10 Only 

; Reason codes passed to fscb^.Func

                        ^ 0
fsfunc_Dir                        # 1 ;0  FSC 0
fsfunc_Lib                        # 1 ;1  FSC 1
fsfunc_Cat                        # 1 ;2  FSC 5
fsfunc_Ex                         # 1 ;3  FSC 6
fsfunc_LCat                       # 1 ;4  FSC 7
fsfunc_LEx                        # 1 ;5  FSC 8
fsfunc_Info                       # 1 ;6  FSC 9
fsfunc_Opt                        # 1 ;7  FSC 10
fsfunc_Rename                     # 1 ;8  FSC 25
fsfunc_Access                     # 1 ;9  FSC 24
fsfunc_Bootup                     # 1 ;10 FSC 15
fsfunc_ReadDiscName               # 1 ;11 GBPB 5
fsfunc_ReadCSDName                # 1 ;12 GBPB 6
fsfunc_ReadLIBName                # 1 ;13 GBPB 7
fsfunc_ReadDirEntries             # 1 ;14 GBPB 9
fsfunc_ReadDirEntriesInfo         # 1 ;15 GBPB 10
fsfunc_ShutDown                   # 1 ;16 FSC 23
fsfunc_PrintBanner                # 1 ;17 internal
fsfunc_SetContexts                # 1 ;18 FSC ??
fsfunc_CatalogObjects             # 1 ;19 GBPB 11
fsfunc_FileInfo                   # 1 ;20 FSC 32 *FileInfo
fsfunc_NewImage                   # 1 ;21 one of your image files has been opened
fsfunc_ImageClosing               # 1 ;22 one of your image files is about to be closed
fsfunc_CanonicaliseSpecialAndDisc # 1 ;23 For canonicalising a path
fsfunc_ResolveWildcard            # 1 ;24 For canonicalising a path
fsfunc_DefectList                 # 1 ;25 For obtaining the image's defect list
fsfunc_AddDefect                  # 1 ;26 For adding a defect
fsfunc_ReadBootOption             # 1 ;27 For reading the boot option
fsfunc_WriteBootOption            # 1 ;28 For writing the boot option
fsfunc_UsedSpaceMap               # 1 ;29 for reading the used space map
fsfunc_ReadFreeSpace              # 1 ;30 for reading the free space
fsfunc_NameDisc                   # 1 ;31 for naming a disc
fsfunc_StampImage                 # 1 ;32 for image stamping control
fsfunc_ObjectAtOffset             # 1 ;33
fsfunc_DirIs                      # 1 ;34 for NetFS (and others if they want)
fsfunc_ReadFreeSpace64            # 1 ;35 for reading the free space in 64 bit (FSC 55)
fsfunc_DefectList64               # 1 ;36 for obtaining the image's defect list (two words per defect)
fsfunc_AddDefect64                # 1 ;37 for adding a defect expressed in two words

        OPT OldOpt
        END
