sysutils.pp 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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 FileRead (Handle : Longint; Var Buffer; Count : longint) : Longint;
  36. begin
  37. end;
  38. Function FileWrite (Handle : Longint; const Buffer; Count : Longint) : Longint;
  39. begin
  40. end;
  41. Function FileSeek (Handle,FOffset,Origin : Longint) : Longint;
  42. begin
  43. end;
  44. Procedure FileClose (Handle : Longint);
  45. begin
  46. end;
  47. Function FileTruncate (Handle,Size: Longint) : boolean;
  48. begin
  49. end;
  50. Function FileAge (Const FileName : String): Longint;
  51. begin
  52. end;
  53. Function FileExists (Const FileName : String) : Boolean;
  54. begin
  55. end;
  56. Function FindFirst (Const Path : String; Attr : Longint; Var Rslt : TSearchRec) : Longint;
  57. begin
  58. end;
  59. Function FindNext (Var Rslt : TSearchRec) : Longint;
  60. begin
  61. end;
  62. Procedure FindClose (Var F : TSearchrec);
  63. begin
  64. end;
  65. Function FileGetDate (Handle : Longint) : Longint;
  66. begin
  67. end;
  68. Function FileSetDate (Handle,Age : Longint) : Longint;
  69. begin
  70. end;
  71. Function FileGetAttr (Const FileName : String) : Longint;
  72. begin
  73. end;
  74. Function FileSetAttr (Const Filename : String; Attr: longint) : Longint;
  75. begin
  76. end;
  77. Function DeleteFile (Const FileName : String) : Boolean;
  78. begin
  79. end;
  80. Function RenameFile (Const OldName, NewName : String) : Boolean;
  81. begin
  82. end;
  83. Function FileSearch (Const Name, DirList : String) : String;
  84. begin
  85. end;
  86. {****************************************************************************
  87. Disk Functions
  88. ****************************************************************************}
  89. Function DiskFree(Drive: Byte): int64;
  90. Begin
  91. End;
  92. Function DiskSize(Drive: Byte): int64;
  93. Begin
  94. End;
  95. Function GetCurrentDir : String;
  96. begin
  97. GetDir(0,Result);
  98. end;
  99. Function SetCurrentDir (Const NewDir : String) : Boolean;
  100. begin
  101. {$I-}
  102. ChDir(NewDir);
  103. {$I+}
  104. result := (IOResult = 0);
  105. end;
  106. Function CreateDir (Const NewDir : String) : Boolean;
  107. begin
  108. {$I-}
  109. MkDir(NewDir);
  110. {$I+}
  111. result := (IOResult = 0);
  112. end;
  113. Function RemoveDir (Const Dir : String) : Boolean;
  114. begin
  115. {$I-}
  116. RmDir(Dir);
  117. {$I+}
  118. result := (IOResult = 0);
  119. end;
  120. {****************************************************************************
  121. Misc Functions
  122. ****************************************************************************}
  123. procedure Beep;
  124. begin
  125. end;
  126. {****************************************************************************
  127. Locale Functions
  128. ****************************************************************************}
  129. Procedure GetLocalTime(var SystemTime: TSystemTime);
  130. begin
  131. end ;
  132. Procedure InitAnsi;
  133. Var
  134. i : longint;
  135. begin
  136. { Fill table entries 0 to 127 }
  137. for i := 0 to 96 do
  138. UpperCaseTable[i] := chr(i);
  139. for i := 97 to 122 do
  140. UpperCaseTable[i] := chr(i - 32);
  141. for i := 123 to 191 do
  142. UpperCaseTable[i] := chr(i);
  143. Move (CPISO88591UCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  144. for i := 0 to 64 do
  145. LowerCaseTable[i] := chr(i);
  146. for i := 65 to 90 do
  147. LowerCaseTable[i] := chr(i + 32);
  148. for i := 91 to 191 do
  149. LowerCaseTable[i] := chr(i);
  150. Move (CPISO88591LCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  151. end;
  152. Procedure InitInternational;
  153. begin
  154. InitAnsi;
  155. end;
  156. function SysErrorMessage(ErrorCode: Integer): String;
  157. begin
  158. Str(Errorcode,Result);
  159. Result:='Error '+Result;
  160. end;
  161. {****************************************************************************
  162. OS utility functions
  163. ****************************************************************************}
  164. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  165. begin
  166. Result:=StrPas(beos.Getenv(PChar(EnvVar)));
  167. end;
  168. {****************************************************************************
  169. Initialization code
  170. ****************************************************************************}
  171. Initialization
  172. InitExceptions; { Initialize exceptions. OS independent }
  173. InitInternational; { Initialize internationalization settings }
  174. Finalization
  175. OutOfMemory.Free;
  176. InValidPointer.Free;
  177. end.
  178. {
  179. $Log$
  180. Revision 1.1 2001-06-02 19:26:03 peter
  181. * BeOS target!
  182. }