sysutils.pp 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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 FreeRTOS 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. {$IFDEF UNICODERTL}
  14. {$MODESWITCH UNICODESTRINGS}
  15. {$ELSE}
  16. {$H+}
  17. {$ENDIF}
  18. {$IFNDEF FPC_DOTTEDUNITS}
  19. unit sysutils;
  20. {$ENDIF FPC_DOTTEDUNITS}
  21. interface
  22. {$DEFINE HAS_SLEEP}
  23. {$DEFINE HAS_OSERROR}
  24. {$modeswitch typehelpers}
  25. {$modeswitch advancedrecords}
  26. { used OS file system APIs use ansistring }
  27. {$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}
  28. { OS has an ansistring/single byte environment variable API }
  29. {$define SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL}
  30. { Include platform independent interface part }
  31. {$i sysutilh.inc}
  32. var
  33. SleepHandler: procedure(ms: cardinal) = nil;
  34. implementation
  35. {$IFDEF FPC_DOTTEDUNITS}
  36. uses
  37. System.SysConst,EmbeddedApi.HeapMGR;
  38. {$ELSE FPC_DOTTEDUNITS}
  39. uses
  40. sysconst,heapmgr;
  41. {$ENDIF FPC_DOTTEDUNITS}
  42. { Include platform independent implementation part }
  43. {$i sysutils.inc}
  44. {****************************************************************************
  45. File Functions
  46. ****************************************************************************}
  47. function FileOpen(const FileName: RawByteString; Mode: Integer): THandle;
  48. begin
  49. result := -1;
  50. end;
  51. function FileGetDate(Handle: THandle) : TOSTimestamp;
  52. begin
  53. result := -1;
  54. end;
  55. function FileSetDate(Handle: THandle; Age: TOSTimestamp) : Longint;
  56. begin
  57. result := -1;
  58. end;
  59. function FileCreate(const FileName: RawByteString) : THandle;
  60. begin
  61. result := -1;
  62. end;
  63. function FileCreate(const FileName: RawByteString; Rights: integer): THandle;
  64. begin
  65. result := -1;
  66. end;
  67. function FileCreate(const FileName: RawByteString; ShareMode: integer; rights : integer): THandle;
  68. begin
  69. result := -1;
  70. end;
  71. function FileRead(Handle: THandle; Out Buffer; Count: LongInt): LongInt;
  72. begin
  73. result := -1;
  74. end;
  75. function FileWrite(Handle: THandle; const Buffer; Count: LongInt): LongInt;
  76. begin
  77. result := -1;
  78. end;
  79. function FileSeek(Handle: THandle; FOffset, Origin: LongInt) : LongInt;
  80. begin
  81. result := -1;
  82. end;
  83. function FileSeek(Handle: THandle; FOffset: Int64; Origin: Longint): Int64;
  84. begin
  85. result := -1;
  86. end;
  87. procedure FileClose(Handle: THandle);
  88. begin
  89. end;
  90. function FileTruncate(Handle: THandle; Size: Int64): Boolean;
  91. begin
  92. result := false;
  93. end;
  94. function DeleteFile(const FileName: RawByteString) : Boolean;
  95. begin
  96. result := false;
  97. end;
  98. function RenameFile(const OldName, NewName: RawByteString): Boolean;
  99. begin
  100. result := false;
  101. end;
  102. Function FileAge (Const FileName : RawByteString): TOSTimestamp;
  103. begin
  104. result := -1;
  105. end;
  106. function FileGetSymLinkTarget(const FileName: RawByteString; out SymLinkRec: TRawbyteSymLinkRec): Boolean;
  107. begin
  108. Result := False;
  109. end;
  110. Function FileExists (Const FileName : RawByteString; FollowLink : Boolean) : Boolean;
  111. Begin
  112. result := false;
  113. end;
  114. Function InternalFindFirst (Const Path : RawByteString; Attr : Longint; out Rslt : TAbstractSearchRec; var Name: RawByteString) : Longint;
  115. begin
  116. result := -1;
  117. end;
  118. Function InternalFindNext (var Rslt : TAbstractSearchRec; var Name : RawByteString) : Longint;
  119. begin
  120. result := -1;
  121. end;
  122. Procedure InternalFindClose(var Handle: THandle);
  123. begin
  124. end;
  125. Function FileGetAttr (Const FileName : RawByteString) : Longint;
  126. begin
  127. result := -1;
  128. end;
  129. Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
  130. begin
  131. result := -1;
  132. end;
  133. {****************************************************************************
  134. Disk Functions
  135. ****************************************************************************}
  136. Procedure AddDisk(const path:string);
  137. begin
  138. end;
  139. Function DiskFree(Drive: Byte): int64;
  140. Begin
  141. result := -1;
  142. End;
  143. Function DiskSize(Drive: Byte): int64;
  144. Begin
  145. result := -1;
  146. End;
  147. function DirectoryExists(const Directory: RawByteString; FollowLink : Boolean): Boolean;
  148. begin
  149. result := false;
  150. end;
  151. {****************************************************************************
  152. Misc Functions
  153. ****************************************************************************}
  154. procedure sysBeep;
  155. begin
  156. end;
  157. Procedure Sleep(Milliseconds : Cardinal);
  158. begin
  159. if assigned(SleepHandler) then
  160. SleepHandler(Milliseconds);
  161. end;
  162. Function GetLastOSError : Integer;
  163. begin
  164. Result:=-1;
  165. end;
  166. {****************************************************************************
  167. Locale Functions
  168. ****************************************************************************}
  169. Procedure GetLocalTime(var SystemTime: TSystemTime);
  170. begin
  171. end ;
  172. function SysErrorMessage(ErrorCode: Integer): String;
  173. begin
  174. { Result:=StrError(ErrorCode);}
  175. result := '';
  176. end;
  177. {****************************************************************************
  178. OS utility functions
  179. ****************************************************************************}
  180. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  181. begin
  182. result := '';
  183. end;
  184. Function GetEnvironmentVariableCount : Integer;
  185. begin
  186. result := -1;
  187. end;
  188. Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
  189. begin
  190. result := '';
  191. end;
  192. function ExecuteProcess (const Path: RawByteString; const ComLine: RawByteString;Flags:TExecuteFlags=[]): integer;
  193. begin
  194. result := -1;
  195. end;
  196. function ExecuteProcess (const Path: RawByteString;
  197. const ComLine: array of RawByteString;Flags:TExecuteFlags=[]): integer;
  198. begin
  199. result := -1;
  200. end;
  201. function ExecuteProcess (const Path: UnicodeString; const ComLine: UnicodeString;Flags:TExecuteFlags=[]): integer;
  202. begin
  203. result := -1;
  204. end;
  205. function ExecuteProcess (const Path: UnicodeString;
  206. const ComLine: array of UnicodeString;Flags:TExecuteFlags=[]): integer;
  207. begin
  208. result := -1;
  209. end;
  210. {****************************************************************************
  211. Initialization code
  212. ****************************************************************************}
  213. Initialization
  214. InitExceptions;
  215. Finalization
  216. FreeTerminateProcs;
  217. DoneExceptions;
  218. end.