sysutils.pp 6.1 KB

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