sysutils.pp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1998 by Florian Klaempfl
  5. member of the Free Pascal development team
  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. {$ifndef VER0_99_5}
  15. {$define USE_EXCEPTIONS}
  16. {$endif}
  17. uses
  18. {$ifdef linux}
  19. linux,
  20. {$else}
  21. dos,
  22. {$ifdef go32v2}
  23. go32,
  24. {$endif go32v2}
  25. {$endif linux}
  26. objpas; { should become platform independent }
  27. type
  28. { some helpful data types }
  29. tprocedure = procedure;
  30. tfilename = string;
  31. longrec = packed record
  32. lo,hi : word;
  33. end;
  34. wordrec = packed record
  35. lo,hi : byte;
  36. end;
  37. {$ifdef USE_EXCEPIONS}
  38. { exceptions }
  39. exception = class(tobject)
  40. private
  41. fmessage : string;
  42. fhelpcontext : longint;
  43. public
  44. constructor create(const msg : string);
  45. //!! No array of const yet.
  46. // constructor createfmt(const msg; const args : array of const);
  47. constructor createres(indent : longint);
  48. { !!!! }
  49. property helpcontext : longint read fhelpcontext write fhelpcontext;
  50. property message : string read fmessage write fmessage;
  51. end;
  52. exceptclass = class of exception;
  53. { math. exceptions }
  54. einterror = class(exception);
  55. edivbyzero = class(einterror);
  56. erangeerror = class(einterror);
  57. eintoverflow = class(einterror);
  58. ematherror = class(exception);
  59. {$endif USE_EXCEPIONS}
  60. { Read date & Time function declarations }
  61. {$i datih.inc}
  62. { Read String Handling functions declaration }
  63. {$i sysstrh.inc}
  64. { Read pchar handling functions declration }
  65. {$i syspchh.inc}
  66. { Read filename handling functions declaration }
  67. {$i finah.inc}
  68. implementation
  69. { Read filename handling functions implementation }
  70. {$i fina.inc}
  71. { Read date & Time function implementations }
  72. {$i dati.inc}
  73. { Read String Handling functions implementation }
  74. {$i sysstr.inc}
  75. { Read pchar handling functions implementation }
  76. {$i syspch.inc}
  77. {$ifdef USE_EXCEPIONS}
  78. constructor exception.create(const msg : string);
  79. begin
  80. inherited create;
  81. message:=msg;
  82. {!!!!!}
  83. end;
  84. {
  85. constructor exception.createfmt(const msg; const args : array of const);
  86. begin
  87. inherited create;
  88. end;
  89. }
  90. constructor exception.createres(indent : longint);
  91. begin
  92. inherited create;
  93. {!!!!!}
  94. end;
  95. {$endif USE_EXCEPIONS}
  96. end.
  97. {
  98. $Log$
  99. Revision 1.7 1998-09-16 14:34:38 pierre
  100. * go32v2 did not compile
  101. * wrong code in systr.inc corrected
  102. Revision 1.6 1998/09/16 08:28:44 michael
  103. Update from gertjan Schouten, plus small fix for linux
  104. Revision 1.5 1998/09/04 08:49:07 peter
  105. * 0.99.5 doesn't compile a whole objpas anymore to overcome crashes
  106. Revision 1.4 1998/08/10 15:52:27 peter
  107. * fixed so 0.99.5 compiles it, but no exception class
  108. Revision 1.3 1998/07/29 15:44:32 michael
  109. included sysutils and math.pp as target. They compile now.
  110. Revision 1.2 1998/04/10 15:18:21 michael
  111. Added a lot of functions donated by GertJan Schouten
  112. Revision 1.1.1.1 1998/03/25 11:18:49 root
  113. * Restored version
  114. Revision 1.1 1998/02/05 11:11:32 michael
  115. + moved to objpas directory
  116. Revision 1.2 1998/02/03 15:27:25 florian
  117. *** empty log message ***
  118. Revision 1.1 1998/02/01 23:32:01 florian
  119. + initial revision
  120. }