sysutils.pp 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 1999-2021 by the Free Pascal development team.
  4. Sysutils unit for The WebAssembly System Interface (WASI).
  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. {$inline on}
  12. unit sysutils;
  13. interface
  14. {$MODE objfpc}
  15. {$MODESWITCH out}
  16. { force ansistrings }
  17. {$H+}
  18. {$modeswitch typehelpers}
  19. {$modeswitch advancedrecords}
  20. uses
  21. wasiapi;
  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. sysconst;
  32. {$DEFINE FPC_FEXPAND_UNC} (* UNC paths are supported *)
  33. {$DEFINE FPC_FEXPAND_DRIVES} (* Full paths begin with drive specification *)
  34. {$DEFINE HAS_LOCALTIMEZONEOFFSET}
  35. {$DEFINE executeprocuni} (* Only 1 byte version of ExecuteProcess is provided by the OS *)
  36. { Include platform independent implementation part }
  37. {$i sysutils.inc}
  38. {****************************************************************************
  39. File Functions
  40. ****************************************************************************}
  41. Function FileOpen (Const FileName : RawByteString; Mode : Integer) : THandle;
  42. Begin
  43. end;
  44. Function FileCreate (Const FileName : RawByteString) : THandle;
  45. begin
  46. end;
  47. Function FileCreate (Const FileName : RawByteString; ShareMode:integer; Rights : integer) : THandle;
  48. begin
  49. end;
  50. Function FileCreate (Const FileName : RawByteString; Rights:integer) : THandle;
  51. begin
  52. end;
  53. Function FileRead (Handle : THandle; Out Buffer; Count : longint) : Longint;
  54. begin
  55. end;
  56. Function FileWrite (Handle : THandle; const Buffer; Count : Longint) : Longint;
  57. begin
  58. end;
  59. Function FileSeek (Handle : THandle; FOffset, Origin : Longint) : Longint;
  60. begin
  61. end;
  62. Function FileSeek (Handle : THandle; FOffset: Int64; Origin: {Integer}Longint) : Int64;
  63. begin
  64. end;
  65. Procedure FileClose (Handle : THandle);
  66. begin
  67. end;
  68. Function FileTruncate (Handle: THandle; Size: Int64) : boolean;
  69. begin
  70. end;
  71. Function FileAge (Const FileName : RawByteString): Int64;
  72. begin
  73. end;
  74. function FileGetSymLinkTarget(const FileName: RawByteString; out SymLinkRec: TRawbyteSymLinkRec): Boolean;
  75. begin
  76. Result := False;
  77. end;
  78. function FileExists (const FileName: RawByteString; FollowLink : Boolean): boolean;
  79. begin
  80. end;
  81. Function DirectoryExists (Const Directory : RawByteString; FollowLink : Boolean) : Boolean;
  82. begin
  83. end;
  84. Function InternalFindFirst (Const Path : RawByteString; Attr : Longint; out Rslt : TAbstractSearchRec; var Name: RawByteString) : Longint;
  85. begin
  86. end;
  87. Function InternalFindNext (var Rslt : TAbstractSearchRec; var Name : RawByteString) : Longint;
  88. begin
  89. end;
  90. Procedure InternalFindClose(var Handle: THandle);
  91. begin
  92. end;
  93. Function FileGetDate (Handle : THandle) : Int64;
  94. begin
  95. end;
  96. Function FileSetDate (Handle : THandle; Age : Int64) : Longint;
  97. begin
  98. end;
  99. Function FileGetAttr (Const FileName : RawByteString) : Longint;
  100. begin
  101. end;
  102. Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
  103. begin
  104. end;
  105. Function DeleteFile (Const FileName : RawByteString) : Boolean;
  106. begin
  107. end;
  108. Function RenameFile (Const OldName, NewName : RawByteString) : Boolean;
  109. begin
  110. end;
  111. {****************************************************************************
  112. Disk Functions
  113. ****************************************************************************}
  114. function diskfree(drive : byte) : int64;
  115. begin
  116. end;
  117. function disksize(drive : byte) : int64;
  118. begin
  119. end;
  120. {****************************************************************************
  121. Time Functions
  122. ****************************************************************************}
  123. {$I tzenv.inc}
  124. Procedure GetLocalTime(var SystemTime: TSystemTime);
  125. begin
  126. end ;
  127. {****************************************************************************
  128. Misc Functions
  129. ****************************************************************************}
  130. procedure sysBeep;
  131. begin
  132. end;
  133. {****************************************************************************
  134. Locale Functions
  135. ****************************************************************************}
  136. procedure InitAnsi;
  137. begin
  138. end;
  139. Procedure InitInternational;
  140. begin
  141. InitInternationalGeneric;
  142. InitAnsi;
  143. end;
  144. function SysErrorMessage(ErrorCode: Integer): String;
  145. begin
  146. Result:=Format(SUnknownErrorCode,[ErrorCode]);
  147. end;
  148. {****************************************************************************
  149. Os utils
  150. ****************************************************************************}
  151. Function GetEnvironmentVariable(Const EnvVar : String) : String;
  152. begin
  153. end;
  154. Function GetEnvironmentVariableCount : Integer;
  155. begin
  156. end;
  157. Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
  158. begin
  159. end;
  160. function ExecuteProcess(Const Path: RawByteString; Const ComLine: RawByteString;Flags:TExecuteFlags=[]):integer;
  161. begin
  162. end;
  163. function ExecuteProcess (const Path: RawByteString;
  164. const ComLine: array of RawByteString;Flags:TExecuteFlags=[]): integer;
  165. begin
  166. end;
  167. {*************************************************************************
  168. Sleep
  169. *************************************************************************}
  170. procedure Sleep (MilliSeconds: Cardinal);
  171. begin
  172. end;
  173. {****************************************************************************
  174. Initialization code
  175. ****************************************************************************}
  176. Initialization
  177. InitExceptions; { Initialize exceptions. OS independent }
  178. InitInternational; { Initialize internationalization settings }
  179. OnBeep:=@SysBeep;
  180. InitTZ;
  181. Finalization
  182. FreeTerminateProcs;
  183. DoneExceptions;
  184. end.