sysutils.pp 6.3 KB

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