home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c220 / 4.ddi / LIB / SRC / STATUS.PF < prev    next >
Encoding:
Text File  |  1990-12-16  |  2.7 KB  |  72 lines

  1. {
  2.   Interface to intercept I/O and heap overflow errors.
  3. }
  4.  
  5. pragma C_include('Implement.pf');
  6. package Status type Error_type;
  7.    pragma Routine_aliasing_convention(Implement.RTE_aliasing);
  8. {
  9.       Error codes
  10. }
  11. type Error_type = Standard.Cardinal;
  12.  
  13. const
  14.    No_error_occurred        = Error_type(0);
  15.    Error_invalid_function    = Error_type(1);
  16.    Error_file_not_found     = Error_type(2);
  17.    Error_path_not_found     = Error_type(3);
  18.    Error_too_many_open_files    = Error_type(4);
  19.    Error_access_denied        = Error_type(5);
  20.    Error_invalid_handle     = Error_type(6);
  21.    Error_arena_trashed        = Error_type(7);
  22.    Error_not_enough_memory    = Error_type(8);
  23.    Error_invalid_block        = Error_type(9);
  24.    Error_bad_environment    = Error_type(10);
  25.    Error_bad_format        = Error_type(11);
  26.    Error_invalid_access     = Error_type(12);
  27.    Error_invalid_data        = Error_type(13);
  28.    Error_reserved        = Error_type(14);
  29.    Error_invalid_drive        = Error_type(15);
  30.    Error_current_directory    = Error_type(16);
  31.    Error_not_same_device    = Error_type(17);
  32.    Error_no_more_files        = Error_type(18);
  33.    Error_invalid_radix        = Error_type(19);
  34.    Error_numeric_read_failed    = Error_type(20);
  35.    Error_write_failed        = Error_type(21);
  36.    Error_eof_encountered    = Error_type(22);
  37.    -- These two are for the C library, use by its floating point routines.
  38.    -- They may also be returned when High C and Professional Pascal
  39.    -- programs are mixed.
  40.    Error_out_of_domain        = Error_type(23);
  41.    Error_out_of_range        = Error_type(24);
  42.  
  43. var Return_IO_status,            -- If true return IO status in Errno.
  44.     Return_heap_status: Boolean;    -- If true return Heap_status.
  45. #if defined(CDOS) and (defined(iAPX386) or defined(NECV60)) 
  46.         -- For FlexOS 386/V60, errno is a global name.
  47.     pragma data(Import);
  48.     pragma data_aliasing_convention(Implement.GLOBAL_ALIASING_CONVENTION);
  49. var Errno: Error_type;            {Err Status of last I/O or}
  50.     pragma data;
  51. #else   
  52.     Errno: Error_type;            -- Err Status of operation.
  53. #endif
  54.     -- When mixing Pascal with C, C's "errno" variable is equated to the
  55.     -- above location.    Thus C library calls may set the Pascal errno variable.
  56.  
  57. type Errstring = Standard.String(36);
  58.  
  59. function Errtext(E: Error_type): Errstring; external;
  60.     -- Returns the text of an error}
  61. type Achar = Loopholes.Address(Char);
  62. function AErrtext(E: Error_Type): Achar; external;
  63.     -- Returns a pointer to the first character of the message, which
  64.     -- is terminated with a NUL.  This is for the C library's use.
  65.  
  66. procedure Perror(const S: String); external;
  67.    {Writes out error message corresponding to Errno to error output.}
  68.    {If S <> '' then the message will be preceded by S || ': ' }
  69.  
  70. end{package};
  71. pragma Alias(Status,Implement.RTE || 'status');
  72.