mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 21:40:34 +02:00
AROS: StdErrout introduced, string fixes, preparations for threading
git-svn-id: trunk@28602 -
This commit is contained in:
parent
684c8842e7
commit
85700afd0d
@ -39,6 +39,7 @@ function SetFileDate(name: PChar; date: PDateStamp): LongBool; syscall AOS_DOSBa
|
|||||||
function NameFromLock(lock: longint; buffer: PChar; len: longint): LongBool; syscall AOS_DOSBase 67;
|
function NameFromLock(lock: longint; buffer: PChar; len: longint): LongBool; syscall AOS_DOSBase 67;
|
||||||
function SetFileSize(fh: longint; pos: longint; mode: longint): longint; syscall AOS_DOSBase 76;
|
function SetFileSize(fh: longint; pos: longint; mode: longint): longint; syscall AOS_DOSBase 76;
|
||||||
function Cli : pCommandLineInterface; syscall AOS_DOSBase 82;
|
function Cli : pCommandLineInterface; syscall AOS_DOSBase 82;
|
||||||
|
function CreateNewProc(const Tags: PTagItem): PProcess; syscall AOS_DOSBase 83;
|
||||||
function GetArgStr: PChar; syscall AOS_DOSBase 89;
|
function GetArgStr: PChar; syscall AOS_DOSBase 89;
|
||||||
function GetCurrentDirName(buf: PChar; len: longint): LongBool; syscall AOS_DOSBase 94;
|
function GetCurrentDirName(buf: PChar; len: longint): LongBool; syscall AOS_DOSBase 94;
|
||||||
function GetProgramName(buf: PChar; len: longint): LongBool; syscall AOS_DOSBase 96;
|
function GetProgramName(buf: PChar; len: longint): LongBool; syscall AOS_DOSBase 96;
|
||||||
|
@ -876,7 +876,7 @@ type
|
|||||||
PStackSwapStruct = ^TStackSwapStruct;
|
PStackSwapStruct = ^TStackSwapStruct;
|
||||||
TStackSwapStruct = record
|
TStackSwapStruct = record
|
||||||
stk_Lower : Pointer; { * Lowest byte of stack * }
|
stk_Lower : Pointer; { * Lowest byte of stack * }
|
||||||
stk_Upper : Pointer; { * Upper end of stack (size + Lowert) * }
|
stk_Upper : Pointer; { * Upper end of stack (size + Lowert) * }
|
||||||
stk_Pointer: Pointer; { * Stack pointer at switch point * }
|
stk_Pointer: Pointer; { * Stack pointer at switch point * }
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -16,11 +16,14 @@
|
|||||||
var
|
var
|
||||||
LocalExecBase : Pointer; external name '_ExecBase';
|
LocalExecBase : Pointer; external name '_ExecBase';
|
||||||
|
|
||||||
|
procedure Forbid; syscall AOS_ExecBase 22;
|
||||||
|
procedure Permit; syscall AOS_ExecBase 23;
|
||||||
function execAllocMem(byteSize: Cardinal; requirements: Cardinal): Pointer; syscall LocalExecBase 33;
|
function execAllocMem(byteSize: Cardinal; requirements: Cardinal): Pointer; syscall LocalExecBase 33;
|
||||||
procedure execFreeMem(memoryBlock: Pointer; byteSize: Cardinal); syscall LocalExecBase 35;
|
procedure execFreeMem(memoryBlock: Pointer; byteSize: Cardinal); syscall LocalExecBase 35;
|
||||||
function FindTask(name: PChar): PTask; syscall LocalExecBase 49;
|
function FindTask(name: PChar): PTask; syscall LocalExecBase 49;
|
||||||
function SetSignal(newSignals: Cardinal; signalSet : Cardinal): Cardinal; syscall LocalExecBase 51;
|
function SetSignal(newSignals: Cardinal; signalSet : Cardinal): Cardinal; syscall LocalExecBase 51;
|
||||||
|
function Wait(SignalSet: LongWord): LongWord; syscall AOS_ExecBase 53;
|
||||||
|
procedure Signal(Task: PTask; SignalSet: LongWord); syscall AOS_ExecBase 54;
|
||||||
function AllocSignal(signalNum: LongInt): ShortInt; syscall LocalExecBase 55;
|
function AllocSignal(signalNum: LongInt): ShortInt; syscall LocalExecBase 55;
|
||||||
procedure FreeSignal(signalNum: LongInt); syscall LocalExecBase 56;
|
procedure FreeSignal(signalNum: LongInt); syscall LocalExecBase 56;
|
||||||
procedure AddPort(port: PMsgPort); syscall LocalExecBase 59;
|
procedure AddPort(port: PMsgPort); syscall LocalExecBase 59;
|
||||||
@ -33,10 +36,15 @@ function OpenDevice(devName: PChar; numunit: Cardinal; ioRequest: pIORequest; fl
|
|||||||
procedure CloseDevice(ioRequest: PIORequest); syscall LocalExecBase 75;
|
procedure CloseDevice(ioRequest: PIORequest); syscall LocalExecBase 75;
|
||||||
function DoIO(ioRequest: PIORequest): ShortInt; syscall LocalExecBase 76;
|
function DoIO(ioRequest: PIORequest): ShortInt; syscall LocalExecBase 76;
|
||||||
function OpenLibrary(libname: PChar; libver : Cardinal): Pointer; syscall LocalExecBase 92;
|
function OpenLibrary(libname: PChar; libver : Cardinal): Pointer; syscall LocalExecBase 92;
|
||||||
|
procedure InitSemaphore(SigSem: PSignalSemaphore); syscall AOS_ExecBase 93;
|
||||||
|
procedure ObtainSemaphore(SigSem: PSignalSemaphore); syscall AOS_ExecBase 94;
|
||||||
|
procedure ReleaseSemaphore(SigSem: PSignalSemaphore); syscall AOS_ExecBase 95;
|
||||||
|
function AttemptSemaphore(SigSem: PSignalSemaphore): LongWord; syscall AOS_ExecBase 96;
|
||||||
function CreatePool(requirements: Cardinal; puddleSize: Cardinal; threshSize: Cardinal): Pointer; syscall LocalExecBase 116;
|
function CreatePool(requirements: Cardinal; puddleSize: Cardinal; threshSize: Cardinal): Pointer; syscall LocalExecBase 116;
|
||||||
procedure DeletePool(poolHeader: Pointer); syscall LocalExecBase 117;
|
procedure DeletePool(poolHeader: Pointer); syscall LocalExecBase 117;
|
||||||
function AllocPooled(poolHeader: Pointer; memSize: Cardinal): Pointer; syscall LocalExecBase 118;
|
function AllocPooled(poolHeader: Pointer; memSize: Cardinal): Pointer; syscall LocalExecBase 118;
|
||||||
function FreePooled(poolHeader: Pointer; memory: Pointer; memSize: Cardinal): Pointer; syscall LocalExecBase 119;
|
function FreePooled(poolHeader: Pointer; memory: Pointer; memSize: Cardinal): Pointer; syscall LocalExecBase 119;
|
||||||
|
procedure StackSwap(NewStack: PStackSwapStruct); syscall AOS_ExecBase 122;
|
||||||
|
|
||||||
//function RawDoFmt(const formatString : pCHAR;const dataStream : POINTER; putChProc : tPROCEDURE; putChData : POINTER): pointer;
|
//function RawDoFmt(const formatString : pCHAR;const dataStream : POINTER; putChProc : tPROCEDURE; putChData : POINTER): pointer;
|
||||||
function RawDoFmt(const formatString : pCHAR;const dataStream : POINTER; putChProc : POINTER; putChData : POINTER): pointer; syscall LocalExecBase 87;
|
function RawDoFmt(const formatString : pCHAR;const dataStream : POINTER; putChProc : POINTER; putChData : POINTER): pointer; syscall LocalExecBase 87;
|
||||||
|
@ -249,6 +249,7 @@ var
|
|||||||
counter: Byte;
|
counter: Byte;
|
||||||
begin
|
begin
|
||||||
GetProgDir:='';
|
GetProgDir:='';
|
||||||
|
SetLength(s1, 256);
|
||||||
FillChar(s1,255,#0);
|
FillChar(s1,255,#0);
|
||||||
{ GetLock of program directory }
|
{ GetLock of program directory }
|
||||||
|
|
||||||
@ -257,7 +258,7 @@ begin
|
|||||||
if NameFromLock(alock,@s1[1],255) then begin
|
if NameFromLock(alock,@s1[1],255) then begin
|
||||||
counter:=1;
|
counter:=1;
|
||||||
while (s1[counter]<>#0) and (counter<>0) do Inc(counter);
|
while (s1[counter]<>#0) and (counter<>0) do Inc(counter);
|
||||||
s1[0]:=Char(counter-1);
|
SetLength(s1, counter-1);
|
||||||
GetProgDir:=s1;
|
GetProgDir:=s1;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -270,13 +271,14 @@ var
|
|||||||
counter: Byte;
|
counter: Byte;
|
||||||
begin
|
begin
|
||||||
GetProgramName:='';
|
GetProgramName:='';
|
||||||
|
SetLength(s1, 256);
|
||||||
FillChar(s1,255,#0);
|
FillChar(s1,255,#0);
|
||||||
|
|
||||||
if GetProgramName(@s1[1],255) then begin
|
if GetProgramName(@s1[1],255) then begin
|
||||||
{ now check out and assign the length of the string }
|
{ now check out and assign the length of the string }
|
||||||
counter := 1;
|
counter := 1;
|
||||||
while (s1[counter]<>#0) and (counter<>0) do Inc(counter);
|
while (s1[counter]<>#0) and (counter<>0) do Inc(counter);
|
||||||
s1[0]:=Char(counter-1);
|
SetLength(s1, counter-1);
|
||||||
|
|
||||||
{ now remove any component path which should not be there }
|
{ now remove any component path which should not be there }
|
||||||
for counter:=length(s1) downto 1 do
|
for counter:=length(s1) downto 1 do
|
||||||
@ -408,11 +410,13 @@ begin
|
|||||||
if AOS_wbMsg = nil then begin
|
if AOS_wbMsg = nil then begin
|
||||||
StdInputHandle := THandle(dosInput);
|
StdInputHandle := THandle(dosInput);
|
||||||
StdOutputHandle := THandle(dosOutput);
|
StdOutputHandle := THandle(dosOutput);
|
||||||
|
StdErrorHandle := THandle(DosError1);
|
||||||
end else begin
|
end else begin
|
||||||
AOS_ConHandle := Open(AOS_ConName, MODE_OLDFILE);
|
AOS_ConHandle := Open(AOS_ConName, MODE_OLDFILE);
|
||||||
if AOS_ConHandle <> 0 then begin
|
if AOS_ConHandle <> 0 then begin
|
||||||
StdInputHandle := AOS_ConHandle;
|
StdInputHandle := AOS_ConHandle;
|
||||||
StdOutputHandle := AOS_ConHandle;
|
StdOutputHandle := AOS_ConHandle;
|
||||||
|
StdErrorHandle := AOS_ConHandle;
|
||||||
end else
|
end else
|
||||||
Halt(1);
|
Halt(1);
|
||||||
end;
|
end;
|
||||||
@ -424,12 +428,7 @@ begin
|
|||||||
OpenStdIO(Input,fmInput,StdInputHandle);
|
OpenStdIO(Input,fmInput,StdInputHandle);
|
||||||
OpenStdIO(Output,fmOutput,StdOutputHandle);
|
OpenStdIO(Output,fmOutput,StdOutputHandle);
|
||||||
OpenStdIO(StdOut,fmOutput,StdOutputHandle);
|
OpenStdIO(StdOut,fmOutput,StdOutputHandle);
|
||||||
|
OpenStdIO(StdErr,fmOutput,StdErrorHandle);
|
||||||
{ * AmigaOS doesn't have a separate stderr * }
|
|
||||||
|
|
||||||
StdErrorHandle:=StdOutputHandle;
|
|
||||||
//OpenStdIO(StdErr,fmOutput,StdErrorHandle);
|
|
||||||
//OpenStdIO(ErrOutput,fmOutput,StdErrorHandle);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetProcessID: SizeUInt;
|
function GetProcessID: SizeUInt;
|
||||||
|
Loading…
Reference in New Issue
Block a user