home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmos2002.zip / SRC / IOERRORC.MOD < prev    next >
Text File  |  1994-05-11  |  3KB  |  95 lines

  1. IMPLEMENTATION MODULE IOErrorCodes;
  2.  
  3.     (********************************************************)
  4.     (*                            *)
  5.     (*        I/O subsystem error codes.        *)
  6.     (*                            *)
  7.     (*  This module provides operations on the file system    *)
  8.     (*            error codes.            *)
  9.     (*                            *)
  10.     (*  Programmer:        P. Moylan            *)
  11.     (*  Last edited:    11 May 1994            *)
  12.     (*  Status:        OK                *)
  13.     (*                            *)
  14.     (********************************************************)
  15.  
  16. FROM Conversions IMPORT
  17.     (* proc *)    CardinalToString;
  18.  
  19. FROM MiscPMOS IMPORT
  20.     (* proc *)    CopyString;
  21.  
  22. (************************************************************************)
  23.  
  24. PROCEDURE TranslateErrorCode (code: ErrorCode;
  25.                 VAR (*OUT*) string: ARRAY OF CHAR);
  26.  
  27.     (* Converts code to its textual representation. *)
  28.  
  29.     BEGIN
  30.     CASE code OF
  31.         OK:            CopyString ("OK", string);
  32.       |
  33.         OperationAborted:    CopyString ("OperationAborted", string);
  34.       |
  35.         FileNotOpen:    CopyString ("FileNotOpen", string);
  36.       |
  37.         NoSuchDevice:    CopyString ("NoSuchDevice", string);
  38.       |
  39.         NoSuchUnit:        CopyString ("NoSuchUnit", string);
  40.       |
  41.         FeatureNotImplemented: CopyString ("FeatureNotImplemented", string);
  42.       |
  43.         InvalidFileNameString: CopyString ("InvalidFileNameString", string);
  44.       |
  45.         DirectoryNotFound:    CopyString ("DirectoryNotFound", string);
  46.       |
  47.         NotADirectory:    CopyString ("NotADirectory", string);
  48.       |
  49.         NameNotFound:    CopyString ("NameNotFound", string);
  50.       |
  51.         DuplicateFileName:    CopyString ("DuplicateFileName", string);
  52.       |
  53.         DeviceFull:        CopyString ("DeviceFull", string);
  54.       |
  55.         DirectoryFull:    CopyString ("DirectoryFull", string);
  56.       |
  57.         BadDMAAddress:    CopyString ("BadDMAAddress", string);
  58.       |
  59.         IllegalBlockNumber:    CopyString ("IllegalBlockNumber", string);
  60.       |
  61.         BadCommand:        CopyString ("BadCommand", string);
  62.       |
  63.         ControllerNotListening: CopyString ("ControllerNotListening", string);
  64.       |
  65.         ControllerOutOfSync: CopyString ("ControllerOutOfSync", string);
  66.       |
  67.         TimeoutError:    CopyString ("TimeoutError", string);
  68.       |
  69.         CalibrationFailure:    CopyString ("CalibrationFailure", string);
  70.       |
  71.         SeekFailure:    CopyString ("SeekFailure", string);
  72.       |
  73.         DriveNotReady:    CopyString ("DriveNotReady", string);
  74.       |
  75.         SectorNotFound:    CopyString ("SectorNotFound", string);
  76.       |
  77.         BadBlock:        CopyString ("BadBlock", string);
  78.       |
  79.         BadData:        CopyString ("BadData", string);
  80.       |
  81.         WriteFault:        CopyString ("WriteFault", string);
  82.       |
  83.         WriteProtected:    CopyString ("WriteProtected", string);
  84.       |
  85.         UndiagnosedFailure:    CopyString ("UndiagnosedFailure", string);
  86.       |
  87.       ELSE
  88.         CardinalToString (ORD(code), string, 6);
  89.     END (*CASE*);
  90.     END TranslateErrorCode;
  91.  
  92. (************************************************************************)
  93.  
  94. END IOErrorCodes.
  95.