sysutils.pp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. {
  2. $Id$
  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. Sysutils unit for linux
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. unit sysutils;
  14. interface
  15. {$MODE objfpc}
  16. { force ansistrings }
  17. {$H+}
  18. uses
  19. beos,
  20. dos;
  21. { Include platform independent interface part }
  22. {$i sysutilh.inc}
  23. implementation
  24. { Include platform independent implementation part }
  25. {$i sysutils.inc}
  26. {****************************************************************************
  27. File Functions
  28. ****************************************************************************}
  29. Function FileOpen (Const FileName : string; Mode : Integer) : Longint;
  30. BEGIN
  31. end;
  32. Function FileCreate (Const FileName : String) : longint;
  33. begin
  34. end;
  35. Function FileCreate (Const FileName : String;Mode:longint) : longint;
  36. begin
  37. end;
  38. Function FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  39. begin
  40. end;
  41. Function FileWrite (Handle : Longint; const Buffer; Count : Longint) : Longint;
  42. begin
  43. end;
  44. Function FileSeek (Handle,FOffset,Origin : longint) : longint;
  45. begin
  46. end;
  47. Function FileSeek (Handle:longint;FOffset,Origin : int64) : int64;
  48. begin
  49. end;
  50. Procedure FileClose (Handle : Longint);
  51. begin
  52. end;
  53. Function FileTruncate (Handle,Size: Longint) : boolean;
  54. begin
  55. end;
  56. Function FileAge (Const FileName : String): Longint;
  57. begin
  58. end;
  59. Function FileExists (Const FileName : String) : Boolean;
  60. begin
  61. end;
  62. Function FindFirst (Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
  63. begin
  64. end;
  65. Function FindNext (Var Rslt : TSearchRec) : Longint;
  66. begin
  67. end;
  68. Procedure FindClose (Var F : TSearchrec);
  69. begin
  70. end;
  71. Function FileGetDate (Handle : Longint) : Longint;
  72. begin
  73. end;
  74. Function FileSetDate (Handle,Age : Longint) : Longint;
  75. begin
  76. end;
  77. Function FileGetAttr (Const FileName : String) : Longint;
  78. begin
  79. end;
  80. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  81. begin
  82. end;
  83. Function DeleteFile (Const FileName : String) : Boolean;
  84. begin
  85. end;
  86. Function RenameFile (Const OldName, NewName : String) : Boolean;
  87. begin
  88. end;
  89. {****************************************************************************
  90. Disk Functions
  91. ****************************************************************************}
  92. Function DiskFree(Drive: Byte): int64;
  93. Begin
  94. End;
  95. Function DiskSize(Drive: Byte): int64;
  96. Begin
  97. End;
  98. Function GetCurrentDir : String;
  99. begin
  100. GetDir(0,Result);
  101. end;
  102. Function SetCurrentDir (Const NewDir : String) : Boolean;
  103. begin
  104. {$I-}
  105. ChDir(NewDir);
  106. {$I+}
  107. result := (IOResult = 0);
  108. end;
  109. Function CreateDir (Const NewDir : String) : Boolean;
  110. begin
  111. {$I-}
  112. MkDir(NewDir);
  113. {$I+}
  114. result := (IOResult = 0);
  115. end;
  116. Function RemoveDir (Const Dir : String) : Boolean;
  117. begin
  118. {$I-}
  119. RmDir(Dir);
  120. {$I+}
  121. result := (IOResult = 0);
  122. end;
  123. {****************************************************************************
  124. Misc Functions
  125. ****************************************************************************}
  126. procedure Beep;
  127. begin
  128. end;
  129. {****************************************************************************
  130. Locale Functions
  131. ****************************************************************************}
  132. Procedure GetLocalTime(var SystemTime: TSystemTime);
  133. begin
  134. end ;
  135. Procedure InitAnsi;
  136. Var
  137. i : longint;
  138. begin
  139. { Fill table entries 0 to 127 }
  140. for i := 0 to 96 do
  141. UpperCaseTable[i] := chr(i);
  142. for i := 97 to 122 do
  143. UpperCaseTable[i] := chr(i - 32);
  144. for i := 123 to 191 do
  145. UpperCaseTable[i] := chr(i);
  146. Move (CPISO88591UCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  147. for i := 0 to 64 do
  148. LowerCaseTable[i] := chr(i);
  149. for i := 65 to 90 do
  150. LowerCaseTable[i] := chr(i + 32);
  151. for i := 91 to 191 do
  152. LowerCaseTable[i] := chr(i);
  153. Move (CPISO88591LCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  154. end;
  155. Procedure InitInternational;
  156. begin
  157. InitAnsi;
  158. end;
  159. function SysErrorMessage(ErrorCode: Integer): String;
  160. begin
  161. Str(Errorcode,Result);
  162. Result:='Error '+Result;
  163. end;
  164. {****************************************************************************
  165. OS utility functions
  166. ****************************************************************************}
  167. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  168. begin
  169. Result:=StrPas(beos.Getenv(PChar(EnvVar)));
  170. end;
  171. {****************************************************************************
  172. Initialization code
  173. ****************************************************************************}
  174. Initialization
  175. InitExceptions; { Initialize exceptions. OS independent }
  176. InitInternational; { Initialize internationalization settings }
  177. Finalization
  178. DoneExceptions;
  179. end.
  180. {
  181. $Log$
  182. Revision 1.4 2003-01-08 21:56:54 marco
  183. * small fixes to prototypes to compile it
  184. Revision 1.3 2002/09/07 16:01:17 peter
  185. * old logs removed and tabs fixed
  186. }