Commit 7708dddf authored by Ben Avison's avatar Ben Avison
Browse files

Reworked error code

Detail:
  Created a new exported header file, Hdr:FileCoreErr, which will serve as
  the single centralised location that defines the error numbers used in the
  low-level FileCore interfaces. s.Errors is now only used for allocating
  error blocks, not for defining error numbers. Also now exports C versions
  of both the pre-existing Hdr:FileCore and the new header.
Admin:
  No changes to the binary.

Version 3.49. Tagged as 'FileCore-3_49'
parent 49fa5460
......@@ -26,6 +26,11 @@ COMPONENT = FileCore
HEADER1 = FileCore
HEADER2 = MultiFS
HEADER3 = FileCoreErr
ASMCHEADER1 = FileCore
CHEADER1 = FileCoreErr
EXPORTS = ${C_EXP_HDR}.FileCore ${C_EXP_HDR}.FileCoreErr
TOKHELPSRC = ${TOKENSOURCE}
HELPSRC = HelpText
......@@ -33,4 +38,17 @@ HELPSRC = HelpText
include StdTools
include AAsmModule
h.FileCoreErr: o.FileCoreErr
${MKDIR} h
${LD} -bin -o $@ o.FileCoreErr
SetType $@ Text
o.FileCoreErr: s.FileCoreErr
${MKDIR} o
${AS} -o $@ s.FileCoreErr -I<Hdr$Dir>.Global,<Hdr$Dir>.Interface
clean::
@IfThere h Then ${ECHO} ${WIPE} h ${WFLAGS}
@IfThere h Then ${WIPE} h ${WFLAGS}
# Dynamic dependencies:
| Copyright 2012 Castle Technology Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine export_hdrs
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "3.48"
Module_Version SETA 348
Module_MajorVersion SETS "3.49"
Module_Version SETA 349
Module_MinorVersion SETS ""
Module_Date SETS "07 Jan 2012"
Module_ApplicationDate SETS "07-Jan-12"
Module_Date SETS "19 Mar 2012"
Module_ApplicationDate SETS "19-Mar-12"
Module_ComponentName SETS "FileCore"
Module_ComponentPath SETS "castle/RiscOS/Sources/FileSys/FileCore"
Module_FullVersion SETS "3.48"
Module_HelpVersion SETS "3.48 (07 Jan 2012)"
Module_FullVersion SETS "3.49"
Module_HelpVersion SETS "3.49 (19 Mar 2012)"
END
/* (3.48)
/* (3.49)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 3.48
#define Module_MajorVersion_CMHG 3.49
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 07 Jan 2012
#define Module_Date_CMHG 19 Mar 2012
#define Module_MajorVersion "3.48"
#define Module_Version 348
#define Module_MajorVersion "3.49"
#define Module_Version 349
#define Module_MinorVersion ""
#define Module_Date "07 Jan 2012"
#define Module_Date "19 Mar 2012"
#define Module_ApplicationDate "07-Jan-12"
#define Module_ApplicationDate "19-Mar-12"
#define Module_ComponentName "FileCore"
#define Module_ComponentPath "castle/RiscOS/Sources/FileSys/FileCore"
#define Module_FullVersion "3.48"
#define Module_HelpVersion "3.48 (07 Jan 2012)"
#define Module_LibraryVersionInfo "3:48"
#define Module_FullVersion "3.49"
#define Module_HelpVersion "3.49 (19 Mar 2012)"
#define Module_LibraryVersionInfo "3:49"
; Copyright (c) 2012, RISC OS Open Ltd
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
; * Redistributions of source code must retain the above copyright
; notice, this list of conditions and the following disclaimer.
; * Redistributions in binary form must reproduce the above copyright
; notice, this list of conditions and the following disclaimer in the
; documentation and/or other materials provided with the distribution.
; * Neither the name of RISC OS Open Ltd nor the names of its contributors
; may be used to endorse or promote products derived from this software
; without specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY RISC OS OPEN LTD ''AS IS'' AND ANY EXPRESS OR
; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
; MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
; EVENT SHALL RISC OS OPEN LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
; WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
; OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
; ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
SUBT Exported FileCore error constants
OldOpt SETA {OPT}
OPT OptNoList+OptNoP1List
[ :LNOT: :DEF: fcerror
GBLS fcerror
fcerror SETS "FileCoreErr"
MACRO
$num FileCoreErr $name, $str
ASSERT &$num>0 ; 0 is used as table terminator in FileCore
ASSERT &$num<&100
$name.Err * &$num
MEND
]
; The argument in the label position is (hex) number which a FileCore client
; filing system can return from its low-level DiscOp or MiscOp calls, or in the
; "Process error" word of a background transfer scatter list. Additionally,
; FileCore will generate errors at that offset into the FS's error block, so the
; filing system should avoid generating those errors itself unless they have the
; same semantics.
; The first postfix argument is used in generating the symbol by which the
; error is referenced. The low-level FileCore error number is called <name>Err
; and filing systems typically define ErrorNumber_<fs><name> and and
; ErrorString_<fs><name>. It is usually also used as the MessageTrans token
; to look up the internationalised version of the error string.
; The second postfix argument is ued to set the value of the
; ErrorString_<fs><name> variable. Typically this is only used by the
; MakeErrorBlock macro (the non-internationalised case).
; In the interests of consistency between FileCore-based filing systems, other
; errors are mentioned in comments. This includes the BBC version of ADFS
; (although only the least-significant byte of error numbers were used there).
11 $fcerror ExtEscape, "Escape"
;70 ; "Format not available for Winnies" (ADFS)
;71 ; "Density not supported" (ADFS)
;72 ; "Sector size not supported" (ADFS)
;73 ; "Too many sectors on a track" (ADFS)
;74 ; "Disc format not known" (ADFS)
;75 ; "Too many defects" (ADFS)
;76 ; "The floppy drive is not connected" (ADFS)
;92 ; "Aborted" (BBC)
;93 ; "No!" (BBC)
94 $fcerror Defect, "Defect cannot be mapped out" ; was "Can't map defect out" before RISC OS 3.1; also "Bad compact" on BBC
95 $fcerror TooManyDefects, "Too many defects"
96 $fcerror CantDelCsd, "Can't delete current directory" ; was "Can't delete CSD" on BBC
97 $fcerror CantDelLib, "Can't delete library"
98 $fcerror CompactReq, "Compaction required"
99 $fcerror MapFull, "Free space map full" ; was "Map full" on BBC
9A $fcerror BadDisc, "Disc not formatted"
9B $fcerror TooManyDiscs, "Too many discs"
9D $fcerror BadUp, "Illegal use of ^"
9E $fcerror AmbigDisc, "Ambiguous disc name"
9F $fcerror NotRefDisc, "Not same disc"
A0 $fcerror InUse, "FileCore in use" ; also "Driver in use" in ADFS
A1 $fcerror BadParms, "Parameters not recognised" ; was "Bad parameters" before RISC OS 3.1
A2 $fcerror CantDelUrd, "Can't delete user root directory"
A5 $fcerror Buffer, "No room for buffer"
A6 $fcerror Workspace, "FileCore Workspace broken" ; was "FileCore Workspace corrupt" before RISC OS 3.1
A7 $fcerror MultipleClose, "Multiple file closing errors"
A8 $fcerror BrokenDir, "Broken directory"
A9 $fcerror BadFsMap, "Bad free space map" ; was "Bad FS map" on BBC; also "No directory" (BBC)
AA $fcerror OneBadFsMap, "One copy of map corrupt (use *CheckMap)" ; also "Bad sum" on BBC
AB $fcerror BadDefectList, "Bad defect list"
AC $fcerror BadDrive, "Disc drive not known" ; was "Bad drive" before RISC OS 3.1
AD $fcerror Size, "Sizes don't match"
AF $fcerror DestDefects, "Destination disc has defects"
B0 $fcerror BadRename, "Bad RENAME"
B3 $fcerror DirFull, "The maximum number of items in a directory has been reached" ; was "Directory full" before RISC OS 3.1, and "Dir full" on BBC
B4 $fcerror DirNotEmpty, "Directory not empty" ; was "Dir not empty" on BBC
;B7 ; "Outside file" (BBC)
BD $fcerror Access, "The access details for this item do not allow this" ; was "Access violation" before RISC OS 3.1
C0 $fcerror TooManyOpen, "Too many open files"
;C1 ; "Not open for update" (BBC)
C2 $fcerror Open, "This file is already open" ; was "File open" before RISC OS 3.1, and "Can't - file open" on BBC
C3 $fcerror Locked, "This item is locked to stop changes being made to it" ; was "Locked" before RISC OS 3.1
C4 $fcerror Exists, "Already exists"
C5 $fcerror Types, "Types don't match"
C6 $fcerror DiscFull, "The disc has no more available space" ; was "Disc full" before RISC OS 3.1
C7 $fcerror Disc, "Disc error"
;C8 ; "Disc changed" (BBC)
C9 $fcerror WriteProt, "The disc is write protected. Move the write-protect tab and try again." ; was "Protected disc" before RISC OS 3.1, and "Disc protected" on BBC
CA $fcerror DataLost, "Data lost"
;CB ; "Bad opt" (BBC)
CC $fcerror BadName, "Name not recognised" ; was "Bad name" before RISC OS 3.1
;CD ; "Drive not ready" (BBC)
CF $fcerror BadAtt, "Bad attribute"
D3 $fcerror DriveEmpty, "The disc drive is empty" ; was "Drive empty" before RISC OS 3.1
D4 $fcerror DiscNotFound, "Disc not found"
D5 $fcerror DiscNotPresent, "Disc not present"
D6 $fcerror NotFound, "Not found"
D7 $fcerror DiscNotFileCore, "FileCore does not understand this disc"
D8 $fcerror NotToAnImageYouDont, "Operation inapplicable to disc images"
DE $fcerror Channel, "Channel"
;DF ; "EOF" (BBC)
E0 $fcerror FSLocked, "The disc is write protected"
E1 $fcerror FileTooBig, "File too big"
;F8 ; "Bad operation on <FS>:" (common to all filing systems)
;F9 ; "<FS>: is a write only filing system" (common to all filing systems)
;FA ; "<FS>: is a read only filing system" (common to all filing systems)
FD $fcerror WildCards, "Wild cards"
FE $fcerror BadCom, "Bad command"
OPT OldOpt
END
......@@ -54,84 +54,22 @@ NewDiscErrorBit bit 0
FileCoreModuleNum * &108
ErrorTable
IntEscapeErr * &80
; Define all the 1-byte error numbers
GET Hdr:FileCoreErr
; Now allocate an error block for each one
fcerror SETS "FileCoreErrBlk"
MACRO
$num error $name,$str
ASSERT &$num>0 ;word aligned 0 byte marks entry end
ASSERT &$num<&100
$name.Err * &$num
$name.ErrBlk & &$num :OR: (FileCoreModuleNum :SHL: 8)
= "$name",0
% (4-(.-Module_BaseAddr):MOD:4):MOD:4 ;align with zeroes
$num FileCoreErrBlk $name, $str
$name.ErrBlk MakeInternatErrorBlock adfs$name,, $name
MEND
ErrorTable
IntEscapeErr * &80
11 error ExtEscape,Escape
;70 error FormatNotSupportedOnWinnie
;71 error DensityNotSupported
;72 error SectorSizeNotSupported
;73 error TooManySectors
;92 ABORTED
;93 WONT
94 error Defect,Can't map defect out
95 error TooManyDefects,Too many defects
96 error CantDelCsd,Can't delete current directory
97 error CantDelLib,Can't delete library
98 error CompactReq,Compaction required
99 error MapFull,Free space map full
9A error BadDisc,Disc not formatted ;not ADFS format
9B error TooManyDiscs,Too many discs
;9C error LibUnset,Library unset
9D error BadUp,Illegal use of ^
9E error AmbigDisc,Ambiguous disc name
9F error NotRefDisc,Not same disc
A0 error InUse,FileCore in use
A1 error BadParms,Bad parameters
A2 error CantDelUrd,Can't delete user root directory
;A3 error IsADir,Is a directory
;A4 error IsAFile,Is a file
A5 error Buffer,No room for buffer
A6 error Workspace,FileCore Workspace corrupt
A7 error MultipleClose,Multiple file closing errors
A8 error BrokenDir,Broken directory
A9 error BadFsMap,Bad free space map
AA error OneBadFsMap,One copy of map corrupt (use *CheckMap)
AB error BadDefectList,Bad defect list
AC error BadDrive,Bad drive
AD error Size,Sizes don't match ;BACKUP
;AE error SameDisc,Same disc ;BACKUP
AF error DestDefects,Destination disc has defects ;BACKUP
B0 error BadRename,Bad RENAME
B3 error DirFull,Directory full
B4 error DirNotEmpty,Directory not empty
;B7 OUTSIDE FILE
BD error Access,Access violation
C0 error TooManyOpen,Too many open files
;C1 NOT OPEN FOR UPDATE
C2 error Open,File open
C3 error Locked,Locked
C4 error Exists,Already exists
C5 error Types,Types don't match
C6 error DiscFull,Disc full
C7 error Disc,Disc error
C9 error WriteProt,Protected disc
CA error DataLost,Data lost
;CB BAD OPT
CC error BadName,Bad name
;CD DRIVE NOT READY
CF error BadAtt,Bad attribute
D3 error DriveEmpty,Drive empty
D4 error DiscNotFound,Disc not found
D5 error DiscNotPresent,Disc not present
D6 error NotFound,Not found
D7 error DiscNotFileCore,FileCore does not understand this disc
D8 error NotToAnImageYouDont,Operation inapplicable to disc images
DE error Channel,Channel
;DF EOF
E0 error FSLocked, The disc is write protected
E1 error FileTooBig, File too big
FD error WildCards,Wild cards
FE error BadCom,Bad command
GET Hdr:ADFSErr ; the table uses ADFS errors, patched up later
GET Hdr:FileCoreErr
& FileCoreModuleNum :SHL: 8 ;end of table marker
= "FileCoreError",0 ;failsafe in case no match found
......
GBLS fcerror
fcerror SETS "FileCoreErr"
MACRO
$num FileCoreErr $name, $str
LCLS line
line SETS "#define $name.Err "
WHILE :LEN: line < 32
line SETS line :CC: " "
WEND
= line, "(0x$num)", 10
MEND
GET ListOpts
GET FSNumbers
AREA Text, DATA
; File header
= "/* This is an autogenerated file, do not edit */", 10, 10
= "#ifndef INTERFACE_FILECOREERR_H_", 10
= "#define INTERFACE_FILECOREERR_H_", 10, 10
; Define all the errors that FileCore generates for the FS
GET FileCoreErr
; File footer
= 10, "#endif", 10
; Pad to word alignment with newline characters
ALIGN 4, 0, 10
END
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment