sysutils.pp 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2004 by the Free Pascal development team
  4. Sysutils unit for the embedded target.
  5. See the file COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {$MODE objfpc}
  12. {$MODESWITCH OUT}
  13. {$H+}
  14. unit sysutils;
  15. interface
  16. {$DEFINE HAS_SLEEP}
  17. {$DEFINE HAS_OSERROR}
  18. { used OS file system APIs use ansistring }
  19. {$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}
  20. { OS has an ansistring/single byte environment variable API }
  21. {$define SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL}
  22. { Include platform independent interface part }
  23. {$i sysutilh.inc}
  24. var
  25. SleepHandler: procedure(ms: cardinal) = nil;
  26. implementation
  27. uses
  28. sysconst,heapmgr;
  29. { Include platform independent implementation part }
  30. {$i sysutils.inc}
  31. {****************************************************************************
  32. File Functions
  33. ****************************************************************************}
  34. function FileOpen(const FileName: RawByteString; Mode: Integer): LongInt;
  35. begin
  36. result := -1;
  37. end;
  38. function FileGetDate(Handle: LongInt) : LongInt;
  39. begin
  40. result := -1;
  41. end;
  42. function FileSetDate(Handle, Age: LongInt) : LongInt;
  43. begin
  44. result := -1;
  45. end;
  46. function FileCreate(const FileName: RawByteString) : LongInt;
  47. begin
  48. result := -1;
  49. end;
  50. function FileCreate(const FileName: RawByteString; Rights: integer): LongInt;
  51. begin
  52. result := -1;
  53. end;
  54. function FileCreate(const FileName: RawByteString; ShareMode: integer; rights : integer): LongInt;
  55. begin
  56. result := -1;
  57. end;
  58. function FileRead(Handle: LongInt; Out Buffer; Count: LongInt): LongInt;
  59. begin
  60. result := -1;
  61. end;
  62. function FileWrite(Handle: LongInt; const Buffer; Count: LongInt): LongInt;
  63. begin
  64. result := -1;
  65. end;
  66. function FileSeek(Handle, FOffset, Origin: LongInt) : LongInt;
  67. begin
  68. result := -1;
  69. end;
  70. function FileSeek(Handle: LongInt; FOffset: Int64; Origin: Longint): Int64;
  71. begin
  72. result := -1;
  73. end;
  74. procedure FileClose(Handle: LongInt);
  75. begin
  76. end;
  77. function FileTruncate(Handle: THandle; Size: Int64): Boolean;
  78. begin
  79. result := false;
  80. end;
  81. function DeleteFile(const FileName: RawByteString) : Boolean;
  82. begin
  83. result := false;
  84. end;
  85. function RenameFile(const OldName, NewName: RawByteString): Boolean;
  86. begin
  87. result := false;
  88. end;
  89. Function FileAge (Const FileName : RawByteString): Longint;
  90. begin
  91. result := -1;
  92. end;
  93. Function FileExists (Const FileName : RawByteString) : Boolean;
  94. Begin
  95. result := false;
  96. end;
  97. Function InternalFindFirst (Const Path : RawByteString; Attr : Longint; out Rslt : TAbstractSearchRec; var Name: RawByteString) : Longint;
  98. begin
  99. result := -1;
  100. end;
  101. Function InternalFindNext (var Rslt : TAbstractSearchRec; var Name : RawByteString) : Longint;
  102. begin
  103. result := -1;
  104. end;
  105. Procedure InternalFindClose(var Handle: THandle);
  106. begin
  107. end;
  108. Function FileGetAttr (Const FileName : RawByteString) : Longint;
  109. begin
  110. result := -1;
  111. end;
  112. Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
  113. begin
  114. result := -1;
  115. end;
  116. {****************************************************************************
  117. Disk Functions
  118. ****************************************************************************}
  119. Procedure AddDisk(const path:string);
  120. begin
  121. end;
  122. Function DiskFree(Drive: Byte): int64;
  123. Begin
  124. result := -1;
  125. End;
  126. Function DiskSize(Drive: Byte): int64;
  127. Begin
  128. result := -1;
  129. End;
  130. function DirectoryExists(const Directory: RawByteString): Boolean;
  131. begin
  132. result := false;
  133. end;
  134. {****************************************************************************
  135. Misc Functions
  136. ****************************************************************************}
  137. procedure sysBeep;
  138. begin
  139. end;
  140. Procedure Sleep(Milliseconds : Cardinal);
  141. begin
  142. if assigned(SleepHandler) then
  143. SleepHandler(Milliseconds);
  144. end;
  145. Function GetLastOSError : Integer;
  146. begin
  147. Result:=-1;
  148. end;
  149. {****************************************************************************
  150. Locale Functions
  151. ****************************************************************************}
  152. Procedure GetLocalTime(var SystemTime: TSystemTime);
  153. begin
  154. end ;
  155. function SysErrorMessage(ErrorCode: Integer): String;
  156. begin
  157. { Result:=StrError(ErrorCode);}
  158. result := '';
  159. end;
  160. {****************************************************************************
  161. OS utility functions
  162. ****************************************************************************}
  163. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  164. begin
  165. result := '';
  166. end;
  167. Function GetEnvironmentVariableCount : Integer;
  168. begin
  169. result := -1;
  170. end;
  171. Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
  172. begin
  173. result := '';
  174. end;
  175. function ExecuteProcess (const Path: AnsiString; const ComLine: AnsiString;Flags:TExecuteFlags=[]): integer;
  176. begin
  177. result := -1;
  178. end;
  179. function ExecuteProcess (const Path: AnsiString;
  180. const ComLine: array of AnsiString;Flags:TExecuteFlags=[]): integer;
  181. begin
  182. result := -1;
  183. end;
  184. {****************************************************************************
  185. Initialization code
  186. ****************************************************************************}
  187. Initialization
  188. InitExceptions;
  189. Finalization
  190. DoneExceptions;
  191. end.