sysutils.pp 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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. function DirectoryExists (const Directory: string): boolean;
  124. begin
  125. end;
  126. {****************************************************************************
  127. Misc Functions
  128. ****************************************************************************}
  129. procedure Beep;
  130. begin
  131. end;
  132. {****************************************************************************
  133. Locale Functions
  134. ****************************************************************************}
  135. Procedure GetLocalTime(var SystemTime: TSystemTime);
  136. begin
  137. end ;
  138. Procedure InitAnsi;
  139. Var
  140. i : longint;
  141. begin
  142. { Fill table entries 0 to 127 }
  143. for i := 0 to 96 do
  144. UpperCaseTable[i] := chr(i);
  145. for i := 97 to 122 do
  146. UpperCaseTable[i] := chr(i - 32);
  147. for i := 123 to 191 do
  148. UpperCaseTable[i] := chr(i);
  149. Move (CPISO88591UCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  150. for i := 0 to 64 do
  151. LowerCaseTable[i] := chr(i);
  152. for i := 65 to 90 do
  153. LowerCaseTable[i] := chr(i + 32);
  154. for i := 91 to 191 do
  155. LowerCaseTable[i] := chr(i);
  156. Move (CPISO88591LCT,UpperCaseTable[192],SizeOf(CPISO88591UCT));
  157. end;
  158. Procedure InitInternational;
  159. begin
  160. InitAnsi;
  161. end;
  162. function SysErrorMessage(ErrorCode: Integer): String;
  163. begin
  164. Str(Errorcode,Result);
  165. Result:='Error '+Result;
  166. end;
  167. {****************************************************************************
  168. OS utility functions
  169. ****************************************************************************}
  170. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  171. begin
  172. Result:=StrPas(beos.Getenv(PChar(EnvVar)));
  173. end;
  174. {****************************************************************************
  175. Initialization code
  176. ****************************************************************************}
  177. Initialization
  178. InitExceptions; { Initialize exceptions. OS independent }
  179. InitInternational; { Initialize internationalization settings }
  180. Finalization
  181. DoneExceptions;
  182. end.
  183. {
  184. $Log$
  185. Revision 1.5 2003-03-29 15:16:26 hajny
  186. * dummy DirectoryExists added
  187. Revision 1.4 2003/01/08 21:56:54 marco
  188. * small fixes to prototypes to compile it
  189. Revision 1.3 2002/09/07 16:01:17 peter
  190. * old logs removed and tabs fixed
  191. }