~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to rtl/objpas/sysutils/sysutilh.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{
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
6
 
 
7
 
    See the file COPYING.FPC, included in this distribution,
8
 
    for details about the copyright.
9
 
 
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.
13
 
 
14
 
 **********************************************************************}
15
 
 
16
 
  { Read date & Time function declarations }
17
 
  {$i osutilsh.inc}
18
 
 
19
 
  {$i datih.inc}
20
 
 
21
 
  { Read String Handling functions declaration }
22
 
  {$i sysstrh.inc}
23
 
 
24
 
type
25
 
   { some helpful data types }
26
 
 
27
 
{$IFDEF VER1_0}
28
 
(* System type alias cannot be used under version *)
29
 
(* 1.0 because of different names of System unit. *)
30
 
   THandle = longint;
31
 
{$ELSE VER1_0}
32
 
   THandle = System.THandle;
33
 
{$ENDIF VER1_0}
34
 
 
35
 
   tprocedure = procedure;
36
 
 
37
 
   tfilename = string;
38
 
 
39
 
   tintegerset = set of 0..sizeof(integer)*8-1;
40
 
 
41
 
   longrec = packed record
42
 
      case integer of
43
 
        0 : (lo,hi : word);
44
 
        1 : (bytes : array[0..3] of byte);
45
 
   end;
46
 
 
47
 
   wordrec = packed record
48
 
      lo,hi : byte;
49
 
   end;
50
 
 
51
 
   int64rec = packed record
52
 
      case integer of
53
 
        0 : (lo,hi : cardinal);
54
 
        1 : (words : array[0..3] of word);
55
 
        2 : (bytes : array[0..7] of byte);
56
 
   end;
57
 
 
58
 
   pbytearray = ^tbytearray;
59
 
   tbytearray = array[0..32767] of byte;
60
 
 
61
 
   pwordarray = ^twordarray;
62
 
   twordarray = array[0..16383] of word;
63
 
 
64
 
   TMethod = packed record
65
 
     Code, Data: Pointer;
66
 
   end;
67
 
 
68
 
   { exceptions }
69
 
   Exception = class(TObject)
70
 
    private
71
 
      fmessage : string;
72
 
      fhelpcontext : longint;
73
 
    public
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);
84
 
      { !!!! }
85
 
      property helpcontext : longint read fhelpcontext write fhelpcontext;
86
 
      property message : string read fmessage write fmessage;
87
 
   end;
88
 
 
89
 
   ExceptClass = class of Exception;
90
 
 
91
 
   EExternal = class(Exception)
92
 
   public
93
 
{$ifdef win32}
94
 
     ExceptionRecord : PExceptionRecord;
95
 
{$endif win32}
96
 
   end;
97
 
 
98
 
   { integer math exceptions }
99
 
   EInterror    = Class(EExternal);
100
 
   EDivByZero   = Class(EIntError);
101
 
   ERangeError  = Class(EIntError);
102
 
   EIntOverflow = Class(EIntError);
103
 
 
104
 
   { General math errors }
105
 
   EMathError  = Class(EExternal);
106
 
   EInvalidOp  = Class(EMathError);
107
 
   EZeroDivide = Class(EMathError);
108
 
   EOverflow   = Class(EMathError);
109
 
   EUnderflow  = Class(EMathError);
110
 
 
111
 
   { Run-time and I/O Errors }
112
 
   EInOutError = class(Exception)
113
 
     public
114
 
       ErrorCode : Longint;
115
 
   end;
116
 
 
117
 
   EHeapMemoryError = class(Exception)
118
 
     protected
119
 
       AllowFree : boolean;
120
 
       procedure FreeInstance;override;
121
 
   end;
122
 
 
123
 
   EHeapException = EHeapMemoryError;
124
 
 
125
 
   EExternalException = class(EExternal);
126
 
   EInvalidPointer  = Class(EHeapMemoryError);
127
 
   EOutOfMemory     = Class(EHeapMemoryError);
128
 
   EInvalidCast = Class(Exception);
129
 
   EVariantError = Class(Exception);
130
 
 
131
 
   EAccessViolation = Class(EExternal);
132
 
   EPrivilege = class(EExternal);
133
 
   EStackOverflow = class(EExternal);
134
 
   EControlC = class(EExternal);
135
 
 
136
 
   { String conversion errors }
137
 
   EConvertError = class(Exception);
138
 
 
139
 
   { Other errors }
140
 
   EAbort           = Class(Exception);
141
 
   EAbstractError   = Class(Exception);
142
 
   EAssertionFailed = Class(Exception);
143
 
 
144
 
   EPropReadOnly = class(Exception);
145
 
   EPropWriteOnly = class(Exception);
146
 
 
147
 
   EIntfCastError = class(Exception);
148
 
   EInvalidContainer = class(Exception);
149
 
   EInvalidInsert = class(Exception);
150
 
 
151
 
   EPackageError = class(Exception);
152
 
 
153
 
   EOSError = class(Exception)
154
 
   public
155
 
     ErrorCode: Longint;
156
 
   end;
157
 
   
158
 
   ESafecallException = class(Exception);
159
 
   ENoThreadSupport = Class(Exception);
160
 
 
161
 
 
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);
168
 
   procedure Abort;
169
 
   procedure OutOfMemoryError;
170
 
   procedure Beep;
171
 
   function SysErrorMessage(ErrorCode: Integer): String;
172
 
 
173
 
type
174
 
  TTerminateProc = function: Boolean;
175
 
 
176
 
  procedure AddTerminateProc(TermProc: TTerminateProc);
177
 
  function CallTerminateProcs: Boolean;
178
 
 
179
 
 
180
 
 
181
 
Var
182
 
   OnShowException : Procedure (Msg : ShortString);
183
 
 
184
 
  { FileRec/TextRec }
185
 
  {$i filerec.inc}
186
 
  {$i textrec.inc}
187
 
 
188
 
Const
189
 
   HexDisplayPrefix : string = '$';
190
 
 
191
 
const
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;
196
 
 
197
 
 
198
 
Type
199
 
   TFileRec=FileRec;
200
 
   TTextRec=TextRec;
201
 
 
202
 
  { Read internationalization settings }
203
 
  {$i sysinth.inc}
204
 
 
205
 
  { Read pchar handling functions declaration }
206
 
  {$IFNDEF VIRTUALPASCAL}
207
 
  {$i syspchh.inc}
208
 
  {$ENDIF}
209
 
 
210
 
  { MCBS functions }
211
 
  {$i sysansih.inc}
212
 
 
213
 
  { Read filename handling functions declaration }
214
 
  {$i finah.inc}
215
 
 
216
 
  { Read other file handling function declarations }
217
 
  {$i filutilh.inc}
218
 
 
219
 
  { Read disk function declarations }
220
 
  {$i diskh.inc}
221
 
 
222
 
  { read thread handling }
223
 
  {$i systhrdh.inc}
224
 
 
225
 
  procedure FreeAndNil(var obj);
226
 
 
227
 
{$ifdef HASINTF}
228
 
  { interface handling }
229
 
  {$i intfh.inc}
230
 
{$endif HASINTF}
231
 
 
232
 
{
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
236
 
      with unix platforms
237
 
 
238
 
  Revision 1.6  2004/01/05 22:37:24  florian
239
 
    * changed sysutils.exec to ExecuteProcess
240
 
 
241
 
  Revision 1.5  2003/11/26 22:17:42  michael
242
 
  + Merged fixbranch fixes, missing in main branch
243
 
 
244
 
  Revision 1.4  2003/11/26 20:12:08  michael
245
 
  + New runerror 231 (exception stack error) and 232 (nothread support)
246
 
 
247
 
  Revision 1.3  2003/11/26 20:00:19  florian
248
 
    * error handling for Variants improved
249
 
 
250
 
  Revision 1.2  2003/10/25 23:43:59  hajny
251
 
    * THandle in sysutils common using System.THandle
252
 
 
253
 
  Revision 1.1  2003/10/06 21:01:06  peter
254
 
    * moved classes unit to rtl
255
 
 
256
 
  Revision 1.20  2003/09/06 20:49:54  marco
257
 
   * Two minimal VP fixes
258
 
 
259
 
  Revision 1.19  2003/01/01 20:58:07  florian
260
 
    + added invalid instruction exception
261
 
 
262
 
  Revision 1.18  2002/10/07 19:43:24  florian
263
 
    + empty prototypes for the AnsiStr* multi byte functions added
264
 
 
265
 
  Revision 1.17  2002/09/07 16:01:22  peter
266
 
    * old logs removed and tabs fixed
267
 
 
268
 
  Revision 1.16  2002/01/25 17:42:03  peter
269
 
    * interface helpers
270
 
 
271
 
}
 
 
b'\\ No newline at end of file'