sysutils.pp 6.0 KB

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