|
@@ -73,7 +73,7 @@ function FileOpen(const FileName: rawbytestring; Mode: Integer): THandle;
|
|
begin
|
|
begin
|
|
{ Mode has some Share modes. Maybe something for MiNT? }
|
|
{ Mode has some Share modes. Maybe something for MiNT? }
|
|
{ Lower three bits of Mode are actually TOS compatible }
|
|
{ Lower three bits of Mode are actually TOS compatible }
|
|
- FileOpen:=gemdos_fopen(pchar(FileName), Mode and 3);
|
|
|
|
|
|
+ FileOpen:=gemdos_fopen(PAnsiChar(FileName), Mode and 3);
|
|
if FileOpen < -1 then
|
|
if FileOpen < -1 then
|
|
FileOpen:=-1;
|
|
FileOpen:=-1;
|
|
end;
|
|
end;
|
|
@@ -116,7 +116,7 @@ end;
|
|
|
|
|
|
function FileCreate(const FileName: RawByteString) : THandle;
|
|
function FileCreate(const FileName: RawByteString) : THandle;
|
|
begin
|
|
begin
|
|
- FileCreate:=gemdos_fcreate(pchar(FileName),0);
|
|
|
|
|
|
+ FileCreate:=gemdos_fcreate(PAnsiChar(FileName),0);
|
|
if FileCreate < -1 then
|
|
if FileCreate < -1 then
|
|
FileCreate:=-1;
|
|
FileCreate:=-1;
|
|
end;
|
|
end;
|
|
@@ -192,13 +192,13 @@ end;
|
|
|
|
|
|
function DeleteFile(const FileName: RawByteString) : Boolean;
|
|
function DeleteFile(const FileName: RawByteString) : Boolean;
|
|
begin
|
|
begin
|
|
- DeleteFile:=gemdos_fdelete(pchar(FileName)) >= 0;
|
|
|
|
|
|
+ DeleteFile:=gemdos_fdelete(PAnsiChar(FileName)) >= 0;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
function RenameFile(const OldName, NewName: RawByteString): Boolean;
|
|
function RenameFile(const OldName, NewName: RawByteString): Boolean;
|
|
begin
|
|
begin
|
|
- RenameFile:=gemdos_frename(0,pchar(oldname),pchar(newname)) >= 0;
|
|
|
|
|
|
+ RenameFile:=gemdos_frename(0,PAnsiChar(oldname),PAnsiChar(newname)) >= 0;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
@@ -257,7 +257,7 @@ begin
|
|
gemdos_setdta(@IFD^.dta_search);
|
|
gemdos_setdta(@IFD^.dta_search);
|
|
|
|
|
|
Rslt.FindHandle:=nil;
|
|
Rslt.FindHandle:=nil;
|
|
- dosResult:=gemdos_fsfirst(pchar(path), Attr and faAnyFile);
|
|
|
|
|
|
+ dosResult:=gemdos_fsfirst(PAnsiChar(path), Attr and faAnyFile);
|
|
if dosResult < 0 then
|
|
if dosResult < 0 then
|
|
begin
|
|
begin
|
|
InternalFindClose(IFD);
|
|
InternalFindClose(IFD);
|
|
@@ -330,13 +330,13 @@ end;
|
|
|
|
|
|
Function FileGetAttr (Const FileName : RawByteString) : Longint;
|
|
Function FileGetAttr (Const FileName : RawByteString) : Longint;
|
|
begin
|
|
begin
|
|
- FileGetAttr:=gemdos_fattrib(pchar(FileName),0,0);
|
|
|
|
|
|
+ FileGetAttr:=gemdos_fattrib(PAnsiChar(FileName),0,0);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
|
|
Function FileSetAttr (Const Filename : RawByteString; Attr: longint) : Longint;
|
|
begin
|
|
begin
|
|
- FileSetAttr:=gemdos_fattrib(pchar(FileName),1,Attr and faAnyFile);
|
|
|
|
|
|
+ FileSetAttr:=gemdos_fattrib(PAnsiChar(FileName),1,Attr and faAnyFile);
|
|
|
|
|
|
if FileSetAttr < -1 then
|
|
if FileSetAttr < -1 then
|
|
FileSetAttr:=-1
|
|
FileSetAttr:=-1
|
|
@@ -464,7 +464,7 @@ end;
|
|
|
|
|
|
Function GetEnvironmentVariableCount : Integer;
|
|
Function GetEnvironmentVariableCount : Integer;
|
|
var
|
|
var
|
|
- hp : pchar;
|
|
|
|
|
|
+ hp : PAnsiChar;
|
|
begin
|
|
begin
|
|
result:=0;
|
|
result:=0;
|
|
hp:=basepage^.p_env;
|
|
hp:=basepage^.p_env;
|
|
@@ -478,7 +478,7 @@ end;
|
|
|
|
|
|
Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
|
|
Function GetEnvironmentString(Index : Integer) : {$ifdef FPC_RTL_UNICODE}UnicodeString{$else}AnsiString{$endif};
|
|
var
|
|
var
|
|
- hp : pchar;
|
|
|
|
|
|
+ hp : PAnsiChar;
|
|
begin
|
|
begin
|
|
result:='';
|
|
result:='';
|
|
hp:=basepage^.p_env;
|
|
hp:=basepage^.p_env;
|
|
@@ -503,10 +503,10 @@ var
|
|
pcmdline: ShortString;
|
|
pcmdline: ShortString;
|
|
CommandLine: RawByteString;
|
|
CommandLine: RawByteString;
|
|
E: EOSError;
|
|
E: EOSError;
|
|
- env, s: pchar;
|
|
|
|
- buf, start: pchar;
|
|
|
|
|
|
+ env, s: PAnsiChar;
|
|
|
|
+ buf, start: PAnsiChar;
|
|
enlen, len: SizeInt;
|
|
enlen, len: SizeInt;
|
|
- hp : pchar;
|
|
|
|
|
|
+ hp : PAnsiChar;
|
|
|
|
|
|
begin
|
|
begin
|
|
tmpPath:=ToSingleByteFileSystemEncodedFileName(Path);
|
|
tmpPath:=ToSingleByteFileSystemEncodedFileName(Path);
|
|
@@ -524,9 +524,9 @@ begin
|
|
end;
|
|
end;
|
|
|
|
|
|
{ count up space needed for arguments }
|
|
{ count up space needed for arguments }
|
|
- len := strlen(PChar(tmpPath)) + 1;
|
|
|
|
|
|
+ len := strlen(PAnsiChar(tmpPath)) + 1;
|
|
inc(enlen, len);
|
|
inc(enlen, len);
|
|
- buf := PChar(ComLine);
|
|
|
|
|
|
+ buf := PAnsiChar(ComLine);
|
|
while (buf^<>#0) do // count nr of args
|
|
while (buf^<>#0) do // count nr of args
|
|
begin
|
|
begin
|
|
while (buf^ in [' ',#9,#10]) do // Kill separators.
|
|
while (buf^ in [' ',#9,#10]) do // Kill separators.
|
|
@@ -580,13 +580,13 @@ begin
|
|
inc(s, 6); { s+=sizeof("ARGV=") }
|
|
inc(s, 6); { s+=sizeof("ARGV=") }
|
|
|
|
|
|
{ copy argv[0] }
|
|
{ copy argv[0] }
|
|
- buf := PChar(tmpPath);
|
|
|
|
|
|
+ buf := PAnsiChar(tmpPath);
|
|
len := strlen(buf) + 1;
|
|
len := strlen(buf) + 1;
|
|
strcopy(s, buf);
|
|
strcopy(s, buf);
|
|
inc(s, len);
|
|
inc(s, len);
|
|
|
|
|
|
{ copy the parameters }
|
|
{ copy the parameters }
|
|
- buf:=PChar(ComLine);
|
|
|
|
|
|
+ buf:=PAnsiChar(ComLine);
|
|
while (buf^<>#0) do
|
|
while (buf^<>#0) do
|
|
begin
|
|
begin
|
|
while (buf^ in [' ',#9,#10]) do // Kill separators.
|
|
while (buf^ in [' ',#9,#10]) do // Kill separators.
|
|
@@ -636,7 +636,7 @@ begin
|
|
pcmdline[0] := #127;
|
|
pcmdline[0] := #127;
|
|
{ the zero offset for cmdline is actually correct here. pexec() expects
|
|
{ the zero offset for cmdline is actually correct here. pexec() expects
|
|
pascal formatted string for cmdline, so length in first byte }
|
|
pascal formatted string for cmdline, so length in first byte }
|
|
- result:=gemdos_pexec(0,PChar(tmpPath),@pcmdline[0],env);
|
|
|
|
|
|
+ result:=gemdos_pexec(0,PAnsiChar(tmpPath),@pcmdline[0],env);
|
|
gemdos_mfree(env);
|
|
gemdos_mfree(env);
|
|
end;
|
|
end;
|
|
|
|
|