sysutils.pp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2000 by Florian Klaempfl
  4. member of the Free Pascal development team
  5. Sysutils unit for netware
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. unit sysutils;
  13. interface
  14. {$MODE objfpc}
  15. {$MODESWITCH OUT}
  16. { force ansistrings }
  17. {$H+}
  18. {$modeswitch typehelpers}
  19. {$modeswitch advancedrecords}
  20. uses DOS;
  21. {$I nwsys.inc}
  22. {$I errno.inc}
  23. {$DEFINE HAS_SLEEP}
  24. {$DEFINE HAS_OSERROR}
  25. { used OS file system APIs use ansistring }
  26. {$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}
  27. { OS has an ansistring/single byte environment variable API }
  28. {$define SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL}
  29. {$DEFINE executeprocuni} (* Only 1 byte version of ExecuteProcess is provided by the OS *)
  30. TYPE
  31. TNetwareFindData =
  32. RECORD
  33. DirP : PNWDirEnt; { used for opendir }
  34. EntryP: PNWDirEnt; { and readdir }
  35. Magic : WORD; { to avoid abends with uninitialized TSearchRec }
  36. END;
  37. { Include platform independent interface part }
  38. {$i sysutilh.inc}
  39. { additional NetWare file flags}
  40. CONST
  41. faSHARE = $00000080; { Sharable file }
  42. faNO_SUBALLOC = $00000800; { Don't sub alloc. this file }
  43. faTRANS = $00001000; { Transactional file (TTS usable) }
  44. faREADAUD = $00004000; { Read audit }
  45. faWRITAUD = $00008000; { Write audit }
  46. faIMMPURG = $00010000; { Immediate purge }
  47. faNORENAM = $00020000; { Rename inhibit }
  48. faNODELET = $00040000; { Delete inhibit }
  49. faNOCOPY = $00080000; { Copy inhibit }
  50. faFILE_MIGRATED = $00400000; { File has been migrated }
  51. faDONT_MIGRATE = $00800000; { Don't migrate this file }
  52. faIMMEDIATE_COMPRESS = $02000000; { Compress this file immediately }
  53. faFILE_COMPRESSED = $04000000; { File is compressed }
  54. faDONT_COMPRESS = $08000000; { Don't compress this file }
  55. faCANT_COMPRESS = $20000000; { Can't compress this file }
  56. faATTR_ARCHIVE = $40000000; { Entry has had an EA modified, }
  57. { an ownerID changed, or trustee }
  58. { info changed, etc. }
  59. implementation
  60. uses
  61. sysconst;
  62. {$define FPC_FEXPAND_DRIVES}
  63. {$define FPC_FEXPAND_VOLUMES}
  64. {$define FPC_FEXPAND_NO_DEFAULT_PATHS}
  65. { Include platform independent implementation part }
  66. {$i sysutils.inc}
  67. {****************************************************************************
  68. File Functions
  69. ****************************************************************************}
  70. Function FileOpen (Const FileName : rawbytestring; Mode : Integer) : THandle;
  71. VAR NWOpenFlags : longint;
  72. SystemFileName: RawByteString;
  73. begin
  74. SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
  75. NWOpenFlags:=0;
  76. Case (Mode and 3) of
  77. 0 : NWOpenFlags:=NWOpenFlags or O_RDONLY;
  78. 1 : NWOpenFlags:=NWOpenFlags or O_WRONLY;
  79. 2 : NWOpenFlags:=NWOpenFlags or O_RDWR;
  80. end;
  81. FileOpen := _open (pchar(SystemFileName),NWOpenFlags,0);
  82. //!! We need to set locking based on Mode !!
  83. end;
  84. Function FileCreate (Const FileName : RawByteString) : THandle;
  85. VAR SystemFileName: RawByteString;
  86. begin
  87. SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
  88. FileCreate:=_open(Pchar(SystemFileName),O_RdWr or O_Creat or O_Trunc,0);
  89. end;
  90. Function FileCreate (Const FileName : RawByteString; Rights:longint) : THandle;
  91. begin
  92. FileCreate:=FileCreate (FileName);
  93. end;
  94. Function FileCreate (Const FileName : RawByteString; ShareMode: Longint; Rights:longint) : THandle;
  95. begin
  96. FileCreate:=FileCreate (FileName);
  97. end;
  98. Function FileRead (Handle : THandle; Out Buffer; Count : longint) : longint;
  99. begin
  100. FileRead:=_read (Handle,@Buffer,Count);
  101. end;
  102. Function FileWrite (Handle : THandle; const Buffer; Count : Longint) : longint;
  103. begin
  104. FileWrite:=_write (Handle,@Buffer,Count);
  105. end;
  106. Function FileSeek (Handle : THandle; FOffset,Origin : Longint) : Longint;
  107. begin
  108. FileSeek:=_lseek (Handle,FOffset,Origin);
  109. end;
  110. Function FileSeek (Handle : THandle; FOffset: Int64; Origin: Longint) : Int64;
  111. begin
  112. {$warning need to add 64bit FileSeek }
  113. FileSeek:=FileSeek(Handle,Longint(FOffset),Longint(Origin));
  114. end;
  115. Procedure FileClose (Handle : THandle);
  116. begin
  117. _close(Handle);
  118. end;
  119. Function FileTruncate (Handle : THandle; Size: Int64) : boolean;
  120. begin
  121. if Size > high (longint) then
  122. FileTruncate := false
  123. {$WARNING Possible support for 64-bit FS to be checked!}
  124. else
  125. FileTruncate:=(_chsize(Handle,Size) = 0);
  126. end;
  127. Function FileAge (Const FileName : RawByteString): Longint;
  128. var Handle: longint;
  129. begin
  130. Handle := FileOpen(FileName, 0);
  131. if Handle <> -1 then
  132. begin
  133. result := FileGetDate(Handle);
  134. FileClose(Handle);
  135. end
  136. else
  137. result := -1;
  138. end;
  139. Function FileLock (Handle,FOffset,FLen : Longint) : Longint;
  140. begin
  141. FileLock := _lock (Handle,FOffset,FLen);
  142. end;
  143. Function FileLock (Handle : Longint; FOffset,FLen : Int64) : Longint;
  144. begin
  145. {$warning need to add 64bit FileLock call }
  146. FileLock := FileLock (Handle, longint(FOffset),longint(FLen));
  147. end;
  148. Function FileUnlock (Handle,FOffset,FLen : Longint) : Longint;
  149. begin
  150. FileUnlock := _unlock (Handle,FOffset,FLen);
  151. end;
  152. Function FileUnlock (Handle : Longint; FOffset,FLen : Int64) : Longint;
  153. begin
  154. {$warning need to add 64bit FileUnlock call }
  155. FileUnlock := FileUnlock (Handle, longint(FOffset),longint(FLen));
  156. end;
  157. Function FileAge (Const FileName : String): Longint;
  158. VAR Info : NWStatBufT;
  159. PTM : PNWTM;
  160. begin
  161. If _stat (pchar(FileName),Info) <> 0 then
  162. exit(-1)
  163. else
  164. begin
  165. PTM := _localtime (Info.st_mtime);
  166. IF PTM = NIL THEN
  167. exit(-1)
  168. else
  169. WITH PTM^ DO
  170. Result:=DateTimeToFileDate(EncodeDate(tm_year+1900,tm_mon+1,tm_mday)+EncodeTime(tm_hour,tm_min,tm_sec,0));
  171. end;
  172. end;
  173. Function FileExists (Const FileName : RawByteString) : Boolean;
  174. VAR Info : NWStatBufT;
  175. SystemFileName: RawByteString;
  176. begin
  177. SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
  178. FileExists:=(_stat(pchar(SystemFileName),Info) = 0);
  179. end;
  180. Function DirectoryExists (Const Directory : RawByteString) : Boolean;
  181. Var
  182. Dir : RawByteString;
  183. drive : byte;
  184. FADir, StoredIORes : longint;
  185. begin
  186. Dir:=Directory;
  187. if (length(dir)=2) and (dir[2]=':') and
  188. ((dir[1] in ['A'..'Z']) or (dir[1] in ['a'..'z'])) then
  189. begin
  190. { We want to test GetCurDir }
  191. if dir[1] in ['A'..'Z'] then
  192. drive:=ord(dir[1])-ord('A')+1
  193. else
  194. drive:=ord(dir[1])-ord('a')+1;
  195. {$push}
  196. {$I-}
  197. StoredIORes:=InOutRes;
  198. InOutRes:=0;
  199. GetDir(drive,dir);
  200. if InOutRes <> 0 then
  201. begin
  202. InOutRes:=StoredIORes;
  203. result:=false;
  204. exit;
  205. end;
  206. end;
  207. {$pop}
  208. if (Length (Dir) > 1) and
  209. (Dir [Length (Dir)] in AllowDirectorySeparators) and
  210. (* Do not remove '\' after ':' (root directory of a drive)
  211. or in '\\' (invalid path, possibly broken UNC path). *)
  212. not (Dir [Length (Dir) - 1] in (AllowDriveSeparators + AllowDirectorySeparators)) then
  213. dir:=copy(dir,1,length(dir)-1);
  214. (* FileGetAttr returns -1 on error *)
  215. FADir := FileGetAttr (Dir);
  216. Result := (FADir <> -1) and
  217. ((FADir and faDirectory) = faDirectory);
  218. end;
  219. PROCEDURE find_setfields (VAR f : TAbstractSearchRec; VAR Name : RawByteString);
  220. VAR T : Dos.DateTime;
  221. BEGIN
  222. WITH F DO
  223. BEGIN
  224. IF FindData.Magic = $AD01 THEN
  225. BEGIN
  226. {attr := FindData.EntryP^.d_attr AND $FF;} // lowest 8 bit -> same as dos
  227. attr := FindData.EntryP^.d_attr; { return complete netware attributes }
  228. UnpackTime(FindData.EntryP^.d_time + (LONGINT (FindData.EntryP^.d_date) SHL 16), T);
  229. time := DateTimeToFileDate(EncodeDate(T.Year,T.Month,T.day)+EncodeTime(T.Hour,T.Min,T.Sec,0));
  230. size := FindData.EntryP^.d_size;
  231. name := FindData.EntryP^.d_nameDOS;
  232. SetCodePage(name, DefaultFileSystemCodePage, false);
  233. END ELSE
  234. BEGIN
  235. name := '';
  236. END;
  237. END;
  238. END;
  239. Function InternalFindFirst (Const Path : RawByteString; Attr : Longint; out Rslt : TAbstractSearchRec; var Name: RawByteString) : Longint;
  240. var
  241. SystemEncodedPath: RawByteString;
  242. begin
  243. IF path = '' then
  244. exit (18);
  245. SystemEncodedPath := ToSingleByteFileSystemEncodedFileName(Path);
  246. Rslt.FindData.DirP := _opendir (pchar(SystemEncodedPath));
  247. IF Rslt.FindData.DirP = NIL THEN
  248. exit (18);
  249. IF attr <> faAnyFile THEN
  250. _SetReaddirAttribute (Rslt.FindData.DirP, attr);
  251. Rslt.FindData.Magic := $AD01;
  252. Rslt.FindData.EntryP := _readdir (Rslt.FindData.DirP);
  253. if Rslt.FindData.EntryP = nil then
  254. begin
  255. _closedir (Rslt.FindData.DirP);
  256. Rslt.FindData.DirP := NIL;
  257. result := 18;
  258. end else
  259. begin
  260. find_setfields (Rslt,Name);
  261. result := 0;
  262. end;
  263. end;
  264. Function InternalFindNext (var Rslt : TAbstractSearchRec; var Name : RawByteString) : Longint;
  265. begin
  266. IF Rslt.FindData.Magic <> $AD01 THEN
  267. exit (18);
  268. Rslt.FindData.EntryP := _readdir (Rslt.FindData.DirP);
  269. IF Rslt.FindData.EntryP = NIL THEN
  270. exit (18);
  271. find_setfields (Rslt,Name);
  272. result := 0;
  273. end;
  274. Procedure InternalFindClose (var Handle: THandle; var FindData: TFindData);
  275. begin
  276. IF FindData.Magic = $AD01 THEN
  277. BEGIN
  278. IF FindData.DirP <> NIL THEN
  279. _closedir (FindData.DirP);
  280. FindData.Magic := 0;
  281. FindData.DirP := NIL;
  282. FindData.EntryP := NIL;
  283. END;
  284. end;
  285. Function FileGetDate (Handle : THandle) : Longint;
  286. Var Info : NWStatBufT;
  287. PTM : PNWTM;
  288. begin
  289. If _fstat(Handle,Info) <> 0 then
  290. Result:=-1
  291. else
  292. begin
  293. PTM := _localtime (Info.st_mtime);
  294. IF PTM = NIL THEN
  295. exit(-1)
  296. else
  297. WITH PTM^ DO
  298. Result:=DateTimeToFileDate(EncodeDate(tm_year+1900,tm_mon+1,tm_mday)+EncodeTime(tm_hour,tm_min,tm_sec,0));
  299. end;
  300. end;
  301. Function FileSetDate (Handle : THandle; Age : Longint) : Longint;
  302. begin
  303. { i think its impossible under netware from FileHandle. I dident found a way to get the
  304. complete pathname of a filehandle, that would be needed for ChangeDirectoryEntry }
  305. FileSetDate:=-1;
  306. ConsolePrintf ('warning: fpc sysutils.FileSetDate not implemented'#13#10,0);
  307. {$warning FileSetDate not implemented (i think is impossible) }
  308. end;
  309. Function FileGetAttr (Const FileName : RawByteString) : Longint;
  310. Var Info : NWStatBufT;
  311. SystemFileName: RawByteString;
  312. begin
  313. SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
  314. If _stat (pchar(SystemFileName),Info) <> 0 then
  315. Result:=-1
  316. Else
  317. Result := Info.st_attr AND $FFFF;
  318. end;
  319. Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
  320. VAR MS : NWModifyStructure;
  321. SystemFileName: RawByteString;
  322. begin
  323. { The Attr parameter is not used! }
  324. SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
  325. FillChar (MS, SIZEOF (MS), 0);
  326. if _ChangeDirectoryEntry (PChar (SystemFilename), MS, MFileAtrributesBit, 0) <> 0 then
  327. result := -1
  328. else
  329. result := 0;
  330. end;
  331. Function DeleteFile (Const FileName : RawByteString) : Boolean;
  332. var
  333. SystemFileName: RawByteString;
  334. begin
  335. SystemFileName:=ToSingleByteFileSystemEncodedFileName(FileName);
  336. Result:= (_UnLink (pchar(SystemFileName)) = 0);
  337. end;
  338. Function RenameFile (Const OldName, NewName : RawByteString) : Boolean;
  339. var
  340. OldSystemFileName, NewSystemFileName: RawByteString;
  341. begin
  342. OldSystemFileName:=ToSingleByteFileSystemEncodedFileName(OldName);
  343. NewSystemFileName:=ToSingleByteFileSystemEncodedFileName(NewName);
  344. RenameFile:=(_rename(pchar(OldSystemFileName),pchar(NewSystemFileName)) = 0);
  345. end;
  346. {****************************************************************************
  347. Disk Functions
  348. ****************************************************************************}
  349. {
  350. The Diskfree and Disksize functions need a file on the specified drive, since this
  351. is required for the statfs system call.
  352. These filenames are set in drivestr[0..26], and have been preset to :
  353. 0 - '.' (default drive - hence current dir is ok.)
  354. 1 - '/fd0/.' (floppy drive 1 - should be adapted to local system )
  355. 2 - '/fd1/.' (floppy drive 2 - should be adapted to local system )
  356. 3 - '/' (C: equivalent of dos is the root partition)
  357. 4..26 (can be set by you're own applications)
  358. ! Use AddDisk() to Add new drives !
  359. They both return -1 when a failure occurs.
  360. }
  361. Const
  362. FixDriveStr : array[0..3] of pchar=(
  363. '.',
  364. 'a:.',
  365. 'b:.',
  366. 'sys:/'
  367. );
  368. var
  369. Drives : byte;
  370. DriveStr : array[4..26] of pchar;
  371. Procedure AddDisk(const path:string);
  372. begin
  373. if not (DriveStr[Drives]=nil) then
  374. FreeMem(DriveStr[Drives],StrLen(DriveStr[Drives])+1);
  375. GetMem(DriveStr[Drives],length(Path)+1);
  376. StrPCopy(DriveStr[Drives],path);
  377. inc(Drives);
  378. if Drives>26 then
  379. Drives:=4;
  380. end;
  381. Function DiskFree(Drive: Byte): int64;
  382. //var fs : statfs;
  383. Begin
  384. { if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and fsstat(StrPas(fixdrivestr[drive]),fs)) or
  385. ((not (drivestr[Drive]=nil)) and fsstat(StrPas(drivestr[drive]),fs)) then
  386. Diskfree:=int64(fs.bavail)*int64(fs.bsize)
  387. else
  388. Diskfree:=-1;}
  389. DiskFree := -1;
  390. ConsolePrintf ('warning: fpc sysutils.diskfree not implemented'#13#10,0);
  391. {$warning DiskFree not implemented (does it make sense ?) }
  392. End;
  393. Function DiskSize(Drive: Byte): int64;
  394. //var fs : statfs;
  395. Begin
  396. { if ((Drive<4) and (not (fixdrivestr[Drive]=nil)) and fsstat(StrPas(fixdrivestr[drive]),fs)) or
  397. ((not (drivestr[Drive]=nil)) and fsstat(StrPas(drivestr[drive]),fs)) then
  398. DiskSize:=int64(fs.blocks)*int64(fs.bsize)
  399. else
  400. DiskSize:=-1;}
  401. DiskSize := -1;
  402. ConsolePrintf ('warning: fpc sysutils.disksize not implemented'#13#10,0);
  403. {$warning DiskSize not implemented (does it make sense ?) }
  404. End;
  405. function DirectoryExists (const Directory: string): boolean;
  406. var
  407. Info : NWStatBufT;
  408. SystemFileName: RawByteString;
  409. begin
  410. SystemFileName:=ToSingleByteFileSystemEncodedFileName(Directory);
  411. If _stat (pchar(SystemFileName),Info) <> 0 then
  412. exit(false)
  413. else
  414. Exit ((Info.st_attr and faDirectory) <> 0);
  415. end;
  416. {****************************************************************************
  417. Misc Functions
  418. ****************************************************************************}
  419. procedure SysBeep;
  420. begin
  421. _RingTheBell;
  422. end;
  423. {****************************************************************************
  424. Locale Functions
  425. ****************************************************************************}
  426. Procedure GetLocalTime(var SystemTime: TSystemTime);
  427. var xx : word;
  428. begin
  429. Dos.GetTime(SystemTime.Hour, SystemTime.Minute, SystemTime.Second, xx);
  430. Dos.GetDate(SystemTime.Year, SystemTime.Month, SystemTime.Day, xx);
  431. SystemTime.MilliSecond := 0;
  432. end;
  433. Procedure InitAnsi;
  434. Var i : longint;
  435. begin
  436. { Fill table entries 0 to 127 }
  437. for i := 0 to 96 do
  438. UpperCaseTable[i] := chr(i);
  439. for i := 97 to 122 do
  440. UpperCaseTable[i] := chr(i - 32);
  441. for i := 123 to 191 do
  442. UpperCaseTable[i] := chr(i);
  443. Move (CPISO88591UCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  444. for i := 0 to 64 do
  445. LowerCaseTable[i] := chr(i);
  446. for i := 65 to 90 do
  447. LowerCaseTable[i] := chr(i + 32);
  448. for i := 91 to 191 do
  449. LowerCaseTable[i] := chr(i);
  450. Move (CPISO88591LCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  451. end;
  452. Procedure InitInternational;
  453. begin
  454. InitInternationalGeneric;
  455. InitAnsi;
  456. end;
  457. function SysErrorMessage(ErrorCode: Integer): String;
  458. begin
  459. Result:=''; // StrError(ErrorCode);
  460. end;
  461. {****************************************************************************
  462. OS utility functions
  463. ****************************************************************************}
  464. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  465. begin
  466. Result:=_getenv(PChar(EnvVar));
  467. end;
  468. Function GetEnvironmentVariableCount : Integer;
  469. begin
  470. // Result:=FPCCountEnvVar(EnvP);
  471. Result:=0;
  472. end;
  473. Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
  474. begin
  475. // Result:=FPCGetEnvStrFromP(Envp,Index);
  476. Result:='';
  477. end;
  478. function ExecuteProcess(Const Path: RawByteString; Const ComLine: RawByteString;Flags:TExecuteFlags=[]):integer;
  479. var
  480. e : EOSError;
  481. CommandLine: RawByteString;
  482. begin
  483. dos.exec(path,comline);
  484. if (Dos.DosError <> 0) then
  485. begin
  486. if ComLine <> '' then
  487. CommandLine := Path + ' ' + ComLine
  488. else
  489. CommandLine := Path;
  490. e:=EOSError.CreateFmt(SExecuteProcessFailed,[CommandLine,Dos.DosError]);
  491. e.ErrorCode:=Dos.DosError;
  492. raise e;
  493. end;
  494. Result := DosExitCode;
  495. end;
  496. function ExecuteProcess (const Path: RawByteString;
  497. const ComLine: array of RawByteString;Flags:TExecuteFlags=[]): integer;
  498. var
  499. CommandLine: RawByteString;
  500. I: integer;
  501. begin
  502. Commandline := '';
  503. for I := 0 to High (ComLine) do
  504. if Pos (' ', ComLine [I]) <> 0 then
  505. CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'
  506. else
  507. CommandLine := CommandLine + ' ' + Comline [I];
  508. ExecuteProcess := ExecuteProcess (Path, CommandLine);
  509. end;
  510. procedure Sleep(milliseconds: Cardinal);
  511. begin
  512. _delay (milliseconds);
  513. end;
  514. Function GetLastOSError : Integer;
  515. begin
  516. Result:=Integer(__get_errno_ptr^);
  517. end;
  518. {****************************************************************************
  519. Initialization code
  520. ****************************************************************************}
  521. Initialization
  522. InitExceptions; { Initialize exceptions. OS independent }
  523. InitInternational; { Initialize internationalization settings }
  524. OnBeep:=@SysBeep;
  525. Finalization
  526. DoneExceptions;
  527. end.