sysutils.pp 5.1 KB

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