sysutils.pp 3.6 KB

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