home *** CD-ROM | disk | FTP | other *** search
- { (C) Copyright 1986-1992 MetaWare Incorporated; Santa Cruz, CA 95060. }
-
- {
- Interface to intercept I/O and heap overflow errors.
- }
-
- pragma C_include('Implement.pf');
- package Status type Error_type;
- pragma Routine_aliasing_convention(Implement.RTE_aliasing);
- {
- Error codes
- }
- type Error_type = Standard.Cardinal;
-
- const
- No_error_occurred = Error_type(0);
- Error_invalid_function = Error_type(1);
- Error_file_not_found = Error_type(2);
- Error_path_not_found = Error_type(3);
- Error_too_many_open_files = Error_type(4);
- Error_access_denied = Error_type(5);
- Error_invalid_handle = Error_type(6);
- Error_arena_trashed = Error_type(7);
- Error_not_enough_memory = Error_type(8);
- Error_invalid_block = Error_type(9);
- Error_bad_environment = Error_type(10);
- Error_bad_format = Error_type(11);
- Error_invalid_access = Error_type(12);
- Error_invalid_data = Error_type(13);
- Error_reserved = Error_type(14);
- Error_invalid_drive = Error_type(15);
- Error_current_directory = Error_type(16);
- Error_not_same_device = Error_type(17);
- Error_no_more_files = Error_type(18);
- Error_invalid_radix = Error_type(19);
- Error_numeric_read_failed = Error_type(20);
- Error_write_failed = Error_type(21);
- Error_eof_encountered = Error_type(22);
- -- These two are for the C library, use by its floating point routines.
- -- They may also be returned when High C and Professional Pascal
- -- programs are mixed.
- Error_out_of_domain = Error_type(23);
- Error_out_of_range = Error_type(24);
-
- var Return_IO_status, -- If true return IO status in Errno.
- Return_heap_status: Boolean; -- If true return Heap_status.
- #if defined(CDOS) and (defined(iAPX386) or defined(NECV60))
- -- For FlexOS 386/V60, errno is a global name.
- pragma data(Import);
- pragma data_aliasing_convention(Implement.GLOBAL_ALIASING_CONVENTION);
- var Errno: Error_type; {Err Status of last I/O or}
- pragma data;
- #else
- Errno: Error_type; -- Err Status of operation.
- #endif
- -- When mixing Pascal with C, C's "errno" variable is equated to the
- -- above location. Thus C library calls may set the Pascal errno variable.
-
- type Errstring = Standard.String(36);
-
- function Errtext(E: Error_type): Errstring; external;
- -- Returns the text of an error}
- type Achar = Loopholes.Address(Char);
- function AErrtext(E: Error_Type): Achar; external;
- -- Returns a pointer to the first character of the message, which
- -- is terminated with a NUL. This is for the C library's use.
-
- procedure Perror(const S: String); external;
- {Writes out error message corresponding to Errno to error output.}
- {If S <> '' then the message will be preceded by S || ': ' }
-
- end{package};
- pragma Alias(Status,Implement.RTE || 'status');
-