2
0

sysutils.pp 5.7 KB

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