/* Error numbers */

/* Error number (errno) Bases */

const *generalErrorBase             := 100
const *fsysErrorBase                := 200
const *streamErrorBase              := 300

const *fileErrorBase                := 400
const *dirErrorBase                 := 500

const *picErrorBase                 := 600
const *penErrorBase                 := 700
const *brushErrorBase               := 800
const *spriteErrorBase              := 900
const *fontErrorBase                := 1000
const *drawErrorBase                := 1100
const *timeErrorBase                := 1200
const *mouseErrorBase               := 1300
const *rgbErrorBase                 := 1400
const *musicErrorBase               := 1500
const *configErrorBase              := 1600
const *viewErrorBase                := 1700
const *windowErrorBase              := 1800
const *printerErrorBase             := 1900
const *textErrorBase                := 2000
const *guiErrorBase                 := 2100
const *lexErrorBase                 := 2200
const *netErrorBase                 := 2300
const *joystickErrorBase            := 2400
const *pcErrorBase                  := 2500
const *sysErrorBase                 := 2600


% No error
const *eNoError                     := 0


% General module

const *eInsufficientMemory          := generalErrorBase+1
const *eNotSupported                := generalErrorBase+2
const *eNoOperation                 := generalErrorBase+3
const *eNoOutputToScreen            := generalErrorBase+4
const *eNotAllowedInTextMode        := generalErrorBase+5
const *eNotAllowedInGraphicsMode    := generalErrorBase+6
const *eMustBeInGraphicsMode        := generalErrorBase+7
const *eUnimplementedFeature        := generalErrorBase+8
const *eEnvironWinCreateFailed      := generalErrorBase+9
const *eUnknownError                := generalErrorBase+99


% FileSys module

const *eFsysFileNotFound            := fsysErrorBase+1
const *eFsysPathNotFound            := fsysErrorBase+2
const *eFsysTooManyOpenFiles        := fsysErrorBase+3
const *eFsysAccessDenied            := fsysErrorBase+4
const *eFsysHandleInvalid           := fsysErrorBase+5
const *eFsysInsufficientMemory      := fsysErrorBase+6
const *eFsysEnvironmentInvalid      := fsysErrorBase+7
const *eFsysFormatInvalid           := fsysErrorBase+8
const *eFsysAccessCodeInvalid       := fsysErrorBase+9
const *eFsysDataInvalid             := fsysErrorBase+10
const *eFsysReadOnly                := fsysErrorBase+11
const *eFsysDiskDriveInvalid        := fsysErrorBase+12
const *eFsysNotSameDevice           := fsysErrorBase+13
const *eFsysNoMoreFiles             := fsysErrorBase+14
const *eFsysWriteProtectedDisk      := fsysErrorBase+15
const *eFsysDriveNotReady           := fsysErrorBase+16
const *eFsysNoDiskInDrive           := fsysErrorBase+17
const *eFsysUnknownCommand          := fsysErrorBase+18
const *eFsysDataErrorCrc            := fsysErrorBase+19
const *eFsysSeekError               := fsysErrorBase+20
const *eFsysUnknownMediaType        := fsysErrorBase+21
const *eFsysSectorNotFound          := fsysErrorBase+22
const *eFsysPrinterOutOfPaper       := fsysErrorBase+23
const *eFsysWriteError              := fsysErrorBase+24
const *eFsysReadError               := fsysErrorBase+25
const *eFsysGeneralFault            := fsysErrorBase+26
const *eFsysNoSpaceLeft             := fsysErrorBase+27
const *eFsysFileExists              := fsysErrorBase+28
const *eFsysDirExists               := fsysErrorBase+29
const *eFsysNotAFile                := fsysErrorBase+30
const *eFsysCantReadFromWdwfile     := fsysErrorBase+31
const *eFsysCantWriteToWdwfile      := fsysErrorBase+32

const *eFsysPathnameModified        := fsysErrorBase+33
const *eFsysCantGoUpFromRootDir     := fsysErrorBase+34
const *eFsysBadCharInPathname       := fsysErrorBase+35
const *eFsysMalformedPathname       := fsysErrorBase+36

const *eFsysFunctionNumberInvalid   := fsysErrorBase+80
const *eFsysMcbDestroyed            := fsysErrorBase+81
const *eFsysMcbInvalid              := fsysErrorBase+82
const *eFsysBadReqLenStruct         := fsysErrorBase+83
const *eFsysUnknownUnit             := fsysErrorBase+84

const *eFsysUnknownError            := fsysErrorBase+99



/* Error numbers grouped by associated OOT predef module */

% Stream module

const *eStreamNotAnId               := streamErrorBase+1
const *eStreamNeverOpened           := streamErrorBase+2
const *eStreamClosed                := streamErrorBase+3
const *eStreamTooManyOpen           := streamErrorBase+4
const *eStreamIllegalOperation      := streamErrorBase+5
const *eStreamUnknownError          := streamErrorBase+99


% File module

const *eFileIsADirectory            := fileErrorBase+1
const *eFileWin95CannotHandleNetworkShare   := fileErrorBase+2
const *eFileCannotGetParentOfRoot   := fileErrorBase+3
const *eFileUnknownError            := fileErrorBase+99

% Dir module

const *eDirNotAnId                  := dirErrorBase+1
const *eDirNeverOpened              := dirErrorBase+2
const *eDirClosed                   := dirErrorBase+3
const *eDirTooManyStreams           := dirErrorBase+4
const *eDirReadPastEof              := dirErrorBase+5
const *eDirNotADirectory            := dirErrorBase+6
const *eDirAttemptedToRemoveCwd     := dirErrorBase+7
const *eDirUnknownError             := dirErrorBase+99


% Pic module

const *ePicNotAnId                  := picErrorBase+1
const *ePicNeverNewed               := picErrorBase+2
const *ePicFreed                    := picErrorBase+3
const *ePicTooMany                  := picErrorBase+4
const *ePicFailure                  := picErrorBase+5
const *ePicBadBox                   := picErrorBase+6
const *ePicNotPicFile               := picErrorBase+7
const *ePicUsedBySprite             := picErrorBase+8
const *ePicNotATakepicArray         := picErrorBase+9
const *ePicNotInSameGraphicsMode    := picErrorBase+10
const *ePicModeOutOfBounds          := picErrorBase+11
const *ePicModeUnsupported          := picErrorBase+12
const *ePicCoordsOffScreen          := picErrorBase+13
const *ePicCantAllocMemForPic       := picErrorBase+14
const *ePicNoMemToConvDrawpic       := picErrorBase+15
const *ePicInsufficientMemory       := picErrorBase+16
const *ePicIOError                  := picErrorBase+17
const *ePicFileNotFound             := picErrorBase+18
const *ePicWriteOpenFailed          := picErrorBase+19
const *ePicUnknownFileFormat        := picErrorBase+20
const *ePicUnsupportedFileFormat    := picErrorBase+21
const *ePicScaleTooSmall            := picErrorBase+22
const *ePicScaleTooLarge            := picErrorBase+23
const *ePicAxisOutOfRange           := picErrorBase+24
const *ePicCantRotateThisDepth      := picErrorBase+25
const *ePicInUseBySprites           := picErrorBase+26
const *ePicBadArraySize             := picErrorBase+27
const *ePicUnknownTransition        := picErrorBase+28
const *ePicUnknownError             := picErrorBase+99


% Pen module

const *ePenNotAnId                  := penErrorBase+1
const *ePenNeverNewed               := penErrorBase+2
const *ePenFreed                    := penErrorBase+3
const *ePenUnknownError             := penErrorBase+99


% Brush module

const *eBrushNotAnId                := brushErrorBase+1
const *eBrushNeverNewed             := brushErrorBase+2
const *eBrushFreed                  := brushErrorBase+3
const *eBrushUnknownError           := brushErrorBase+99


% Sprite module

const *eSpriteNotAnId               := spriteErrorBase+1
const *eSpriteNeverNewed            := spriteErrorBase+2
const *eSpriteFreed                 := spriteErrorBase+3
const *eSpriteTooMany               := spriteErrorBase+4
const *eSpriteNoChange              := spriteErrorBase+5
const *eSpriteUnknownError          := spriteErrorBase+99


% Font module

const *eFontNotAnId                 := fontErrorBase+1
const *eFontNeverNewed              := fontErrorBase+2
const *eFontFreed                   := fontErrorBase+3
const *eFontCantFreeDefault         := fontErrorBase+4
const *eFontTooMany                 := fontErrorBase+5
const *eFontUnknownError            := fontErrorBase+99


% Draw module

const *eDrawClipped                 := drawErrorBase+1
const *eDrawFailure                 := drawErrorBase+2
const *eDrawTooComplicated          := drawErrorBase+3
const *eDrawClrNumTooSmall          := drawErrorBase+4
const *eDrawClrNumTooLarge          := drawErrorBase+5
const *eDrawCantAllocPolyPts        := drawErrorBase+6
const *eDrawUnknownError            := drawErrorBase+99


% Time module

const *eTimeInvalidTimeStr          := timeErrorBase+1
const *eTimeInvalidDateStr          := timeErrorBase+2
const *eTimeSecondsOutOfRange       := timeErrorBase+3
const *eTimeBadDay                  := timeErrorBase+4
const *eTimeBadMonth                := timeErrorBase+5
const *eTimeBadYear                 := timeErrorBase+6
const *eTimeBadHour                 := timeErrorBase+7
const *eTimeBadMinute               := timeErrorBase+8
const *eTimeBadSecond               := timeErrorBase+9
const *eTimeUnknownError            := timeErrorBase+99


% Mouse module

const *eMouseNoneInstalled          := mouseErrorBase+1
const *eMouseBadButtonchooseStr     := mouseErrorBase+2
const *eMouseBadButtonmotionStr     := mouseErrorBase+3
const *eMouseUnknownError           := mouseErrorBase+99


% rgb module

const *eRgbBadNum                   := rgbErrorBase+1
const *eRgbFailure                  := rgbErrorBase+2
const *eRgbCouldNotSetClr           := rgbErrorBase+3
const *eRgbRedOutOfRange            := rgbErrorBase+4
const *eRgbGreenOutOfRange          := rgbErrorBase+5
const *eRgbBlueOutOfRange           := rgbErrorBase+6
const *eRgbUnknownError             := rgbErrorBase+99


% Music module

const *eMusicNoNotes                := musicErrorBase+1
const *eMusicBadPlayChar            := musicErrorBase+2
const *eMusicBadNoteLength          := musicErrorBase+3
const *eMusicFrequencyOutOfRange    := musicErrorBase+4
const *eMusicDurationOutOfRange     := musicErrorBase+5
const *eMusicMidiOpenError          := musicErrorBase+6
const *eMusicMidiPlayError          := musicErrorBase+7
const *eMusicCDOpenError            := musicErrorBase+8
const *eMusicCDPlayError            := musicErrorBase+9
const *eMusicWaveOpenError          := musicErrorBase+10
const *eMusicWavePlayError          := musicErrorBase+11
const *eMusicCloserror              := musicErrorBase+12
const *eMusicGetStatusError         := musicErrorBase+13
const *eMusicNoteOpenError          := musicErrorBase+14
const *eMusicNotePlayError          := musicErrorBase+15
const *eMusicFreqOpenError          := musicErrorBase+16
const *eMusicFreqPlayError          := musicErrorBase+17
const *eMusicMP3OpenError           := musicErrorBase+18
const *eMusicMP3PlayError           := musicErrorBase+19
const *eMusicDisabled               := musicErrorBase+20
const *eMusicUnknownFileTypeError   := musicErrorBase+21
const *eMusicIOError                := musicErrorBase+22
const *eMusicBadMusicFile           := musicErrorBase+23
const *eMusicUnknownError           := musicErrorBase+99


% Config module

const *eConfigUnknownDisplayCode    := configErrorBase+1
const *eConfigUnknownLangCode       := configErrorBase+2
const *eConfigUnknownMachineCode    := configErrorBase+3
const *eConfigCantGetInformation    := configErrorBase+4
const *eConfigUnknownError          := configErrorBase+99


% View module

const *eViewOutsideClippingRegion   := viewErrorBase+1
const *eViewXTooSmall               := viewErrorBase+2
const *eViewXTooLarge               := viewErrorBase+3
const *eViewYTooSmall               := viewErrorBase+4
const *eViewYTooLarge               := viewErrorBase+5
const *eViewSetBadCursorSize        := viewErrorBase+6
const *eViewSetUnknownGraphMode     := viewErrorBase+7
const *eViewSetBadGraphicsMode      := viewErrorBase+8
const *eViewSetUnknownGraphDepth    := viewErrorBase+9
const *eViewSetUnsuppGraphMode      := viewErrorBase+10
const *eViewSetGraphicsModeFailed   := viewErrorBase+11
const *eViewSetBadPosition          := viewErrorBase+12
const *eViewSetUnknownSetCommand    := viewErrorBase+13
const *eViewUnknownError            := viewErrorBase+99


% Window module

const *eWindowNotAnId               := windowErrorBase+1
const *eWindowNeverOpened           := windowErrorBase+2
const *eWindowClosed                := windowErrorBase+3
const *eWindowSetBadOption          := windowErrorBase+4
const *eWindowGetFromInvisible      := windowErrorBase+5
const *eWindowObsoleteOpen          := windowErrorBase+6
const *eWindowObsoleteClose         := windowErrorBase+7
const *eWindowCantSeek              := windowErrorBase+8
const *eWindowCantTell              := windowErrorBase+9
const *eWindowCantRead              := windowErrorBase+10
const *eWindowCantWrite             := windowErrorBase+11
const *eWindowUnknownError          := windowErrorBase+99


% Printer module

const *ePrinterNotAnId              := printerErrorBase+1
const *ePrinterNeverOpened          := printerErrorBase+2
const *ePrinterClosed               := printerErrorBase+3
const *ePrinterObsoleteOpen         := printerErrorBase+4
const *ePrinterObsoleteClose        := printerErrorBase+5
const *ePrinterCantSeek             := printerErrorBase+6
const *ePrinterCantTell             := printerErrorBase+7
const *ePrinterCantRead             := printerErrorBase+8
const *ePrinterCantWrite            := printerErrorBase+9
const *ePrinterUnknownError         := printerErrorBase+99


% Text module

const *eTextRowTooSmall             := textErrorBase+1
const *eTextRowTooLarge             := textErrorBase+2
const *eTextColTooSmall             := textErrorBase+3
const *eTextColTooLarge             := textErrorBase+4
const *eTextUnknownError            := textErrorBase+99


% gui module

const *eGuiMissingButtonText        := guiErrorBase+1


% Lexer module

const *eLexNotAnId                  := lexErrorBase+1
const *eLexNeverInitialized         := lexErrorBase+2
const *eLexTooManyStreams           := lexErrorBase+3
const *eLexStreamAlreadyOpen        := lexErrorBase+4
const *eLexTableError               := lexErrorBase+5
const *eLexUnknownError             := lexErrorBase+99


% Net module


% Joystick module


% PC module


% Sys module
const *eSysUnknownError             := sysErrorBase
const *eSysEnvVarNotFound           := sysErrorBase+1
const *eSysEnvVarTooLong            := sysErrorBase+2
const *eSysNotEnoughSystemMemory    := sysErrorBase+3
const *eSysBadExeFile               := sysErrorBase+4
const *eSysAccessDenied             := sysErrorBase+5
const *eSysBadFileAssoc             := sysErrorBase+6
const *eSysNoFileAssoc              := sysErrorBase+7
const *eSysSharingViolation         := sysErrorBase+8
const *eSysSysExecNotAllowed        := sysErrorBase+9

/* End of error numbers */
