| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 | {    This file is part of the Free Pascal run time library.    Copyright (c) 2004 by Karoly Balogh    Sysutils unit for Gameboy Advance.    This unit is based on the MorphOS one and is adapted for Gameboy Advance    simply by stripping out all stuff inside funcs and procs.    Copyright (c) 2006 by Francesco Lombardi    Based on Amiga version by Carl Eric Codere, and other    parts of the RTL    See the file COPYING.FPC, included in this distribution,    for details about the copyright.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************}{$IFNDEF FPC_DOTTEDUNITS}unit sysutils;{$ENDIF FPC_DOTTEDUNITS}interface{$MODE objfpc}{$MODESWITCH OUT}{$IFDEF UNICODERTL}{$MODESWITCH UNICODESTRINGS}{$ELSE}{$H+}{$ENDIF}{$modeswitch typehelpers}{$modeswitch advancedrecords}{$DEFINE HAS_SLEEP}{$DEFINE HAS_OSERROR}{ used OS file system APIs use ansistring }{$define SYSUTILS_HAS_ANSISTR_FILEUTIL_IMPL}{ OS has an ansistring/single byte environment variable API }{$define SYSUTILS_HAS_ANSISTR_ENVVAR_IMPL}{ Include platform independent interface part }{$i sysutilh.inc}implementation{$IFDEF FPC_DOTTEDUNITS}uses  TP.DOS, System.SysConst;{$ELSE FPC_DOTTEDUNITS}uses  dos, sysconst;{$ENDIF FPC_DOTTEDUNITS}{ Include platform independent implementation part }{$i sysutils.inc}{****************************************************************************                              File Functions****************************************************************************}function FileOpen(const FileName: rawbytestring; Mode: Integer): LongInt;begin  result := -1;end;function FileGetDate(Handle: LongInt) : Int64;begin  result := -1;end;function FileSetDate(Handle: Longint; Age: Int64) : LongInt;begin  result := -1;end;function FileCreate(const FileName: RawByteString) : LongInt;begin  result := -1;end;function FileCreate(const FileName: RawByteString; Rights: integer): LongInt;begin  result := -1;end;function FileCreate(const FileName: RawByteString; ShareMode: integer; rights : integer): LongInt;begin  result := -1;end;function FileRead(Handle: LongInt; Out Buffer; Count: LongInt): LongInt;begin  result := -1;end;function FileWrite(Handle: LongInt; const Buffer; Count: LongInt): LongInt;begin  result := -1;end;function FileSeek(Handle, FOffset, Origin: LongInt) : LongInt;begin  result := -1;end;function FileSeek(Handle: LongInt; FOffset: Int64; Origin: Longint): Int64;begin  result := -1;end;procedure FileClose(Handle: LongInt);beginend;function FileTruncate(Handle: THandle; Size: Int64): Boolean;begin  result := false;end;function DeleteFile(const FileName: RawByteString) : Boolean;begin  result := false;end;function RenameFile(const OldName, NewName: RawByteString): Boolean;begin  result := false;end;(****** end of non portable routines ******)Function FileAge (Const FileName : RawByteString): Int64;begin  result := -1;end;function FileGetSymLinkTarget(const FileName: RawByteString; out SymLinkRec: TRawbyteSymLinkRec): Boolean;begin  Result := False;end;Function FileExists (Const FileName : RawByteString; FollowLink : Boolean) : Boolean;Begin  result := false;end;Function InternalFindFirst (Const Path : RawByteString; Attr : Longint; out Rslt : TAbstractSearchRec; var Name: RawByteString) : Longint;begin  result := -1;end;Function InternalFindNext (var Rslt : TAbstractSearchRec; var Name : RawByteString) : Longint;begin  result := -1;end;Procedure InternalFindClose(var Handle: THandle);beginend;Function FileGetAttr (Const FileName : RawByteString) : Longint;begin  result := -1;end;Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;begin  result := -1;end;{****************************************************************************                              Disk Functions****************************************************************************}Procedure AddDisk(const path:string);beginend;Function DiskFree(Drive: Byte): int64;Begin  result := -1;End;Function DiskSize(Drive: Byte): int64;Begin  result := -1;End;function DirectoryExists(const Directory: RawByteString; FollowLink : Boolean): Boolean;begin  result := false;end;{****************************************************************************                              Misc Functions****************************************************************************}procedure sysBeep;beginend;Procedure Sleep(Milliseconds : Cardinal);var  i,j : Cardinal;  calib : Cardinal;begin{$warning no idea if this calibration value is correct (FK) }{ I estimated it roughly on the CPU clock of 16 MHz and 1+3 clock cycles for the loop }  calib:=4000000;  for i:=1 to Milliseconds do    asm      ldr r0,calib    .L1:      sub r0,r0,#1      bne .L1    end;end;Function GetLastOSError : Integer;begin  Result:=-1;end;{****************************************************************************                              Locale Functions****************************************************************************}Procedure GetLocalTime(var SystemTime: TSystemTime);beginend ;function SysErrorMessage(ErrorCode: Integer): String;begin{  Result:=StrError(ErrorCode);}  result := '';end;{****************************************************************************                              OS utility functions****************************************************************************}Function GetEnvironmentVariable(Const EnvVar : String) : String;begin  result := '';end;Function GetEnvironmentVariableCount : Integer;begin  result := -1;end;Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};begin  result := '';end;function ExecuteProcess (const Path: RawByteString; const ComLine: RawByteString;Flags:TExecuteFlags=[]): integer;begin  result := -1;end;function ExecuteProcess (const Path: RawByteString;                                  const ComLine: array of RawByteString;Flags:TExecuteFlags=[]): integer;begin  result := -1;end;function ExecuteProcess(const Path: UnicodeString; const ComLine: UnicodeString;  Flags: TExecuteFlags = []): Integer;begin  { TODO : implement }  result := -1;end;function ExecuteProcess(const Path: UnicodeString;  const ComLine: Array of UnicodeString; Flags:TExecuteFlags = []): Integer;var  CommandLine: UnicodeString;  I: integer;begin  Commandline := '';  for I := 0 to High (ComLine) do   if Pos (' ', ComLine [I]) <> 0 then    CommandLine := CommandLine + ' ' + '"' + ComLine [I] + '"'   else    CommandLine := CommandLine + ' ' + Comline [I];  ExecuteProcess := ExecuteProcess (Path, CommandLine,Flags);end;{****************************************************************************                              Initialization code****************************************************************************}Initialization  InitExceptions;Finalization  FreeTerminateProcs;  DoneExceptions;end.
 |