2
$Id: sysutilh.inc,v 1.7 2004/01/28 22:09:52 peter Exp $
3
This file is part of the Free Pascal run time library.
4
Copyright (c) 1999-2000 by Florian Klaempfl
5
member of the Free Pascal development team
7
See the file COPYING.FPC, included in this distribution,
8
for details about the copyright.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
**********************************************************************}
16
{ Read date & Time function declarations }
21
{ Read String Handling functions declaration }
25
{ some helpful data types }
28
(* System type alias cannot be used under version *)
29
(* 1.0 because of different names of System unit. *)
32
THandle = System.THandle;
35
tprocedure = procedure;
39
tintegerset = set of 0..sizeof(integer)*8-1;
41
longrec = packed record
44
1 : (bytes : array[0..3] of byte);
47
wordrec = packed record
51
int64rec = packed record
53
0 : (lo,hi : cardinal);
54
1 : (words : array[0..3] of word);
55
2 : (bytes : array[0..7] of byte);
58
pbytearray = ^tbytearray;
59
tbytearray = array[0..32767] of byte;
61
pwordarray = ^twordarray;
62
twordarray = array[0..16383] of word;
64
TMethod = packed record
69
Exception = class(TObject)
72
fhelpcontext : longint;
74
constructor Create(const msg : string);
75
constructor CreateFmt(const msg : string; const args : array of const);
76
constructor CreateRes(ResString: PString);
77
constructor CreateResFmt(ResString: PString; const Args: array of const);
78
constructor CreateHelp(const Msg: string; AHelpContext: Integer);
79
constructor CreateFmtHelp(const Msg: string; const Args: array of const;
80
AHelpContext: Integer);
81
constructor CreateResHelp(ResString: PString; AHelpContext: Integer);
82
constructor CreateResFmtHelp(ResString: PString; const Args: array of const;
83
AHelpContext: Integer);
85
property helpcontext : longint read fhelpcontext write fhelpcontext;
86
property message : string read fmessage write fmessage;
89
ExceptClass = class of Exception;
91
EExternal = class(Exception)
94
ExceptionRecord : PExceptionRecord;
98
{ integer math exceptions }
99
EInterror = Class(EExternal);
100
EDivByZero = Class(EIntError);
101
ERangeError = Class(EIntError);
102
EIntOverflow = Class(EIntError);
104
{ General math errors }
105
EMathError = Class(EExternal);
106
EInvalidOp = Class(EMathError);
107
EZeroDivide = Class(EMathError);
108
EOverflow = Class(EMathError);
109
EUnderflow = Class(EMathError);
111
{ Run-time and I/O Errors }
112
EInOutError = class(Exception)
117
EHeapMemoryError = class(Exception)
120
procedure FreeInstance;override;
123
EHeapException = EHeapMemoryError;
125
EExternalException = class(EExternal);
126
EInvalidPointer = Class(EHeapMemoryError);
127
EOutOfMemory = Class(EHeapMemoryError);
128
EInvalidCast = Class(Exception);
129
EVariantError = Class(Exception);
131
EAccessViolation = Class(EExternal);
132
EPrivilege = class(EExternal);
133
EStackOverflow = class(EExternal);
134
EControlC = class(EExternal);
136
{ String conversion errors }
137
EConvertError = class(Exception);
140
EAbort = Class(Exception);
141
EAbstractError = Class(Exception);
142
EAssertionFailed = Class(Exception);
144
EPropReadOnly = class(Exception);
145
EPropWriteOnly = class(Exception);
147
EIntfCastError = class(Exception);
148
EInvalidContainer = class(Exception);
149
EInvalidInsert = class(Exception);
151
EPackageError = class(Exception);
153
EOSError = class(Exception)
158
ESafecallException = class(Exception);
159
ENoThreadSupport = Class(Exception);
162
{ Exception handling routines }
163
function ExceptObject: TObject;
164
function ExceptAddr: Pointer;
165
function ExceptionErrorMessage(ExceptObject: TObject; ExceptAddr: Pointer;
166
Buffer: PChar; Size: Integer): Integer;
167
procedure ShowException(ExceptObject: TObject; ExceptAddr: Pointer);
169
procedure OutOfMemoryError;
171
function SysErrorMessage(ErrorCode: Integer): String;
174
TTerminateProc = function: Boolean;
176
procedure AddTerminateProc(TermProc: TTerminateProc);
177
function CallTerminateProcs: Boolean;
182
OnShowException : Procedure (Msg : ShortString);
189
HexDisplayPrefix : string = '$';
192
// commenting is VP fix. These idents are in a different unit there.
193
PathDelim={System.}DirectorySeparator;
194
DriveDelim={System.}DriveSeparator;
195
PathSep={System.}PathSeparator;
202
{ Read internationalization settings }
205
{ Read pchar handling functions declaration }
206
{$IFNDEF VIRTUALPASCAL}
213
{ Read filename handling functions declaration }
216
{ Read other file handling function declarations }
219
{ Read disk function declarations }
222
{ read thread handling }
225
procedure FreeAndNil(var obj);
228
{ interface handling }
233
$Log: sysutilh.inc,v $
234
Revision 1.7 2004/01/28 22:09:52 peter
235
* EOSError.errorcode change to Longint which is more compatible
238
Revision 1.6 2004/01/05 22:37:24 florian
239
* changed sysutils.exec to ExecuteProcess
241
Revision 1.5 2003/11/26 22:17:42 michael
242
+ Merged fixbranch fixes, missing in main branch
244
Revision 1.4 2003/11/26 20:12:08 michael
245
+ New runerror 231 (exception stack error) and 232 (nothread support)
247
Revision 1.3 2003/11/26 20:00:19 florian
248
* error handling for Variants improved
250
Revision 1.2 2003/10/25 23:43:59 hajny
251
* THandle in sysutils common using System.THandle
253
Revision 1.1 2003/10/06 21:01:06 peter
254
* moved classes unit to rtl
256
Revision 1.20 2003/09/06 20:49:54 marco
257
* Two minimal VP fixes
259
Revision 1.19 2003/01/01 20:58:07 florian
260
+ added invalid instruction exception
262
Revision 1.18 2002/10/07 19:43:24 florian
263
+ empty prototypes for the AnsiStr* multi byte functions added
265
Revision 1.17 2002/09/07 16:01:22 peter
266
* old logs removed and tabs fixed
268
Revision 1.16 2002/01/25 17:42:03 peter
b'\\ No newline at end of file'