* Dup second arg must be var arg !

This commit is contained in:
pierre 1999-02-22 10:32:10 +00:00
parent 5befcfad1e
commit ebb2c9f47d

View File

@ -174,48 +174,48 @@ Const
NCC = 8; NCC = 8;
{ For Terminal handling } { For Terminal handling }
TCGETS = $5401; TCGETS = $5401;
TCSETS = $5402; TCSETS = $5402;
TCSETSW = $5403; TCSETSW = $5403;
TCSETSF = $5404; TCSETSF = $5404;
TCGETA = $5405; TCGETA = $5405;
TCSETA = $5406; TCSETA = $5406;
TCSETAW = $5407; TCSETAW = $5407;
TCSETAF = $5408; TCSETAF = $5408;
TCSBRK = $5409; TCSBRK = $5409;
TCXONC = $540A; TCXONC = $540A;
TCFLSH = $540B; TCFLSH = $540B;
TIOCEXCL = $540C; TIOCEXCL = $540C;
TIOCNXCL = $540D; TIOCNXCL = $540D;
TIOCSCTTY = $540E; TIOCSCTTY = $540E;
TIOCGPGRP = $540F; TIOCGPGRP = $540F;
TIOCSPGRP = $5410; TIOCSPGRP = $5410;
TIOCOUTQ = $5411; TIOCOUTQ = $5411;
TIOCSTI = $5412; TIOCSTI = $5412;
TIOCGWINSZ = $5413; TIOCGWINSZ = $5413;
TIOCSWINSZ = $5414; TIOCSWINSZ = $5414;
TIOCMGET = $5415; TIOCMGET = $5415;
TIOCMBIS = $5416; TIOCMBIS = $5416;
TIOCMBIC = $5417; TIOCMBIC = $5417;
TIOCMSET = $5418; TIOCMSET = $5418;
TIOCGSOFTCAR = $5419; TIOCGSOFTCAR = $5419;
TIOCSSOFTCAR = $541A; TIOCSSOFTCAR = $541A;
FIONREAD = $541B; FIONREAD = $541B;
TIOCINQ = FIONREAD; TIOCINQ = FIONREAD;
TIOCLINUX = $541C; TIOCLINUX = $541C;
TIOCCONS = $541D; TIOCCONS = $541D;
TIOCGSERIAL = $541E; TIOCGSERIAL = $541E;
TIOCSSERIAL = $541F; TIOCSSERIAL = $541F;
TIOCPKT = $5420; TIOCPKT = $5420;
FIONBIO = $5421; FIONBIO = $5421;
TIOCNOTTY = $5422; TIOCNOTTY = $5422;
TIOCSETD = $5423; TIOCSETD = $5423;
TIOCGETD = $5424; TIOCGETD = $5424;
TCSBRKP = $5425; TCSBRKP = $5425;
TIOCTTYGSTRUCT = $5426; TIOCTTYGSTRUCT = $5426;
FIONCLEX = $5450; FIONCLEX = $5450;
FIOCLEX = $5451; FIOCLEX = $5451;
FIOASYNC = $5452; FIOASYNC = $5452;
TIOCSERCONFIG = $5453; TIOCSERCONFIG = $5453;
TIOCSERGWILD = $5454; TIOCSERGWILD = $5454;
TIOCSERSWILD = $5455; TIOCSERSWILD = $5455;
@ -247,11 +247,11 @@ Type
TWinSize=winsize; TWinSize=winsize;
Termio = packed record Termio = packed record
c_iflag, { input mode flags } c_iflag, { input mode flags }
c_oflag, { output mode flags } c_oflag, { output mode flags }
c_cflag, { control mode flags } c_cflag, { control mode flags }
c_lflag : Word; { local mode flags } c_lflag : Word; { local mode flags }
c_line : Word; { line discipline - careful, only High byte in use} c_line : Word; { line discipline - careful, only High byte in use}
c_cc : array [0..NCC-1] of char;{ control characters } c_cc : array [0..NCC-1] of char;{ control characters }
end; end;
TTermio=Termio; TTermio=Termio;
@ -449,12 +449,12 @@ Type
totalswap, totalswap,
freeswap : longint; freeswap : longint;
procs : integer; procs : integer;
s : string[18]; s : string[18];
end; end;
PSysInfo = ^TSysInfo; PSysInfo = ^TSysInfo;
{****************************************************************************** {******************************************************************************
Procedure/Functions Procedure/Functions
******************************************************************************} ******************************************************************************}
Function SysCall(callnr:longint;var regs:SysCallregs):longint; Function SysCall(callnr:longint;var regs:SysCallregs):longint;
@ -539,7 +539,7 @@ Function FSStat(Path:Pathstr;Var Info:statfs):Boolean;
Function FSStat(Fd: Longint;Var Info:statfs):Boolean; Function FSStat(Fd: Longint;Var Info:statfs):Boolean;
Function Fcntl(Fd:Text;Cmd:Integer):integer; Function Fcntl(Fd:Text;Cmd:Integer):integer;
Procedure Fcntl(Fd:Text;Cmd:Integer;Arg:Longint); Procedure Fcntl(Fd:Text;Cmd:Integer;Arg:Longint);
Function Dup(oldfile,newfile:longint):Boolean; Function Dup(oldfile:longint;var newfile:longint):Boolean;
Function Dup(var oldfile,newfile:text):Boolean; Function Dup(var oldfile,newfile:text):Boolean;
Function Dup(var oldfile,newfile:file):Boolean; Function Dup(var oldfile,newfile:file):Boolean;
Function Dup2(oldfile,newfile:longint):Boolean; Function Dup2(oldfile,newfile:longint):Boolean;
@ -587,7 +587,7 @@ Function Sysinfo(var Info:TSysinfo):Boolean;
Function Uname(var unamerec:utsname):Boolean; Function Uname(var unamerec:utsname):Boolean;
{************************** {**************************
Signal Signal
***************************} ***************************}
Procedure SigAction(Signum:Integer;Var Act,OldAct:PSigActionRec ); Procedure SigAction(Signum:Integer;Var Act,OldAct:PSigActionRec );
@ -671,7 +671,7 @@ Function S_ISSOCK(m:integer):boolean;
{****************************************************************************** {******************************************************************************
Implementation Implementation
******************************************************************************} ******************************************************************************}
Implementation Implementation
@ -692,7 +692,7 @@ var
{****************************************************************************** {******************************************************************************
Process related calls Process related calls
******************************************************************************} ******************************************************************************}
function CreateShellArgV(const prog:string):ppchar; function CreateShellArgV(const prog:string):ppchar;
@ -892,7 +892,7 @@ Function Shell(const Command:String):Longint;
If the Exec call failed exit status 127 is reported. If the Exec call failed exit status 127 is reported.
} }
var var
p : ppchar; p : ppchar;
temp,pid : longint; temp,pid : longint;
begin begin
pid:=fork; pid:=fork;
@ -916,14 +916,14 @@ Function GetPriority(Which,Who:Integer):integer;
{ {
Get Priority of process, process group, or user. Get Priority of process, process group, or user.
Which : selects what kind of priority is used. Which : selects what kind of priority is used.
can be one of the following predefined Constants : can be one of the following predefined Constants :
Prio_User. Prio_User.
Prio_PGrp. Prio_PGrp.
Prio_Process. Prio_Process.
Who : depending on which, this is , respectively : Who : depending on which, this is , respectively :
Uid Uid
Pid Pid
Process Group id Process Group id
Errors are reported in linuxerror _only_. (priority can be negative) Errors are reported in linuxerror _only_. (priority can be negative)
} }
var var
@ -951,16 +951,16 @@ Procedure SetPriority(Which:Integer;Who:Integer;What:Integer);
{ {
Set Priority of process, process group, or user. Set Priority of process, process group, or user.
Which : selects what kind of priority is used. Which : selects what kind of priority is used.
can be one of the following predefined Constants : can be one of the following predefined Constants :
Prio_User. Prio_User.
Prio_PGrp. Prio_PGrp.
Prio_Process. Prio_Process.
Who : depending on value of which, this is, respectively : Who : depending on value of which, this is, respectively :
Uid Uid
Pid Pid
Process Group id Process Group id
what : A number between -20 and 20. -20 is most favorable, 20 least. what : A number between -20 and 20. -20 is most favorable, 20 least.
0 is the default. 0 is the default.
} }
var var
sr : Syscallregs; sr : Syscallregs;
@ -1072,7 +1072,7 @@ end;
{****************************************************************************** {******************************************************************************
Date and Time related calls Date and Time related calls
******************************************************************************} ******************************************************************************}
Const Const
@ -1212,7 +1212,7 @@ Function LocalToEpoch(year,month,day,hour,minute,second:Word):Longint;
} }
Begin Begin
LocalToEpoch:=((GregorianToJulian(Year,Month,Day)-c1970)*86400)+ LocalToEpoch:=((GregorianToJulian(Year,Month,Day)-c1970)*86400)+
(LongInt(Hour)*3600)+(Minute*60)+Second+(LocalTZ.minuteswest*60); (LongInt(Hour)*3600)+(Minute*60)+Second+(LocalTZ.minuteswest*60);
End; End;
@ -1267,7 +1267,7 @@ end;
{****************************************************************************** {******************************************************************************
FileSystem calls FileSystem calls
******************************************************************************} ******************************************************************************}
Function fdOpen(pathname:string;flags:longint):longint; Function fdOpen(pathname:string;flags:longint):longint;
@ -1382,13 +1382,13 @@ begin
Linuxerror:=SysCall(Syscall_nr_fcntl,sr); Linuxerror:=SysCall(Syscall_nr_fcntl,sr);
if linuxerror=-1 then if linuxerror=-1 then
begin begin
linuxerror:=errno; linuxerror:=errno;
fcntl:=0; fcntl:=0;
end end
else else
begin begin
fcntl:=linuxerror; fcntl:=linuxerror;
linuxerror:=0; linuxerror:=0;
end; end;
end end
else else
@ -1708,7 +1708,7 @@ begin
end; end;
Function Dup(oldfile,newfile:longint):Boolean; Function Dup(oldfile:longint;var newfile:longint):Boolean;
{ {
Copies the filedescriptor oldfile to newfile Copies the filedescriptor oldfile to newfile
} }
@ -1857,7 +1857,7 @@ end;
{****************************************************************************** {******************************************************************************
Directory Directory
******************************************************************************} ******************************************************************************}
Function OpenDir(F:String):PDir; Function OpenDir(F:String):PDir;
@ -1906,16 +1906,16 @@ end;
{****************************************************************************** {******************************************************************************
Pipes/Fifo Pipes/Fifo
******************************************************************************} ******************************************************************************}
Procedure OpenPipe(var F:Text); Procedure OpenPipe(var F:Text);
begin begin
case textrec(f).mode of case textrec(f).mode of
fmoutput : if textrec(f).userdata[1]<>P_OUT then fmoutput : if textrec(f).userdata[1]<>P_OUT then
textrec(f).mode:=fmclosed; textrec(f).mode:=fmclosed;
fminput : if textrec(f).userdata[1]<>P_IN then fminput : if textrec(f).userdata[1]<>P_IN then
textrec(f).mode:=fmclosed; textrec(f).mode:=fmclosed;
else else
textrec(f).mode:=fmclosed; textrec(f).mode:=fmclosed;
end; end;
@ -1926,11 +1926,11 @@ Procedure IOPipe(var F:text);
begin begin
case textrec(f).mode of case textrec(f).mode of
fmoutput : begin fmoutput : begin
{ first check if we need something to write, else we may { first check if we need something to write, else we may
get a SigPipe when Close() is called (PFV) } get a SigPipe when Close() is called (PFV) }
if textrec(f).bufpos>0 then if textrec(f).bufpos>0 then
Sys_write(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufpos); Sys_write(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufpos);
end; end;
fminput : textrec(f).bufend:=Sys_read(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufsize); fminput : textrec(f).bufend:=Sys_read(textrec(f).handle,pchar(textrec(f).bufptr),textrec(f).bufsize);
end; end;
textrec(f).bufpos:=0; textrec(f).bufpos:=0;
@ -2116,19 +2116,19 @@ begin
{ We're in the child } { We're in the child }
if rw='W' then if rw='W' then
begin begin
close(pipo); close(pipo);
dup2(pipi,input); dup2(pipi,input);
close(pipi); close(pipi);
if linuxerror<>0 then if linuxerror<>0 then
halt(127); halt(127);
end end
else else
begin begin
close(pipi); close(pipi);
dup2(pipo,output); dup2(pipo,output);
close(pipo); close(pipo);
if linuxerror<>0 then if linuxerror<>0 then
halt(127); halt(127);
end; end;
pp:=createshellargv(prog); pp:=createshellargv(prog);
Execve(pp^,pp,envp); Execve(pp^,pp,envp);
@ -2139,15 +2139,15 @@ begin
{ We're in the parent } { We're in the parent }
if rw='W' then if rw='W' then
begin begin
close(pipi); close(pipi);
f:=pipo; f:=pipo;
textrec(f).bufptr:=@textrec(f).buffer; textrec(f).bufptr:=@textrec(f).buffer;
end end
else else
begin begin
close(pipo); close(pipo);
f:=pipi; f:=pipi;
textrec(f).bufptr:=@textrec(f).buffer; textrec(f).bufptr:=@textrec(f).buffer;
end; end;
{Save the process ID - needed when closing } {Save the process ID - needed when closing }
pl:=@(textrec(f).userdata[2]); pl:=@(textrec(f).userdata[2]);
@ -2195,19 +2195,19 @@ begin
{ We're in the child } { We're in the child }
if rw='W' then if rw='W' then
begin begin
close(pipo); close(pipo);
dup2(filerec(pipi).handle,stdinputhandle); dup2(filerec(pipi).handle,stdinputhandle);
close(pipi); close(pipi);
if linuxerror<>0 then if linuxerror<>0 then
halt(127); halt(127);
end end
else else
begin begin
close(pipi); close(pipi);
dup2(filerec(pipo).handle,stdoutputhandle); dup2(filerec(pipo).handle,stdoutputhandle);
close(pipo); close(pipo);
if linuxerror<>0 then if linuxerror<>0 then
halt(127); halt(127);
end; end;
getmem(pp,sizeof(pchar)*4); getmem(pp,sizeof(pchar)*4);
temp:='/bin/sh'#0'-c'#0+prog+#0; temp:='/bin/sh'#0'-c'#0+prog+#0;
@ -2226,13 +2226,13 @@ begin
{ We're in the parent } { We're in the parent }
if rw='W' then if rw='W' then
begin begin
close(pipi); close(pipi);
f:=pipo; f:=pipo;
end end
else else
begin begin
close(pipo); close(pipo);
f:=pipi; f:=pipi;
end; end;
{Save the process ID - needed when closing } {Save the process ID - needed when closing }
pl:=@(filerec(f).userdata[2]); pl:=@(filerec(f).userdata[2]);
@ -2260,7 +2260,7 @@ Procedure AssignStream(Var StreamIn,Streamout:text;Const Prog:String);
specified in 'Prog'. specified in 'Prog'.
streamout can be used to write to the program, streamin can be used to read streamout can be used to write to the program, streamin can be used to read
the output of the program. See the following diagram : the output of the program. See the following diagram :
Parent Child Parent Child
STreamout --> Input STreamout --> Input
Streamin <-- Output Streamin <-- Output
} }
@ -2322,7 +2322,7 @@ end;
{****************************************************************************** {******************************************************************************
General information calls General information calls
******************************************************************************} ******************************************************************************}
Function Sysinfo(var Info:TSysinfo):Boolean; Function Sysinfo(var Info:TSysinfo):Boolean;
@ -2362,17 +2362,17 @@ var
ep : ppchar; ep : ppchar;
found : boolean; found : boolean;
Begin Begin
p:=p+'='; {Else HOST will also find HOSTNAME, etc} p:=p+'='; {Else HOST will also find HOSTNAME, etc}
ep:=envp; ep:=envp;
found:=false; found:=false;
if ep<>nil then if ep<>nil then
begin begin
while (not found) and (ep^<>nil) do while (not found) and (ep^<>nil) do
begin begin
if strlcomp(@p[1],(ep^),length(p))=0 then if strlcomp(@p[1],(ep^),length(p))=0 then
found:=true found:=true
else else
ep:=ep+4; ep:=ep+4;
end; end;
end; end;
if found then if found then
@ -2417,15 +2417,15 @@ end;
{****************************************************************************** {******************************************************************************
Signal handling calls Signal handling calls
******************************************************************************} ******************************************************************************}
Function Kill(Pid:longint;Sig:integer):integer; Function Kill(Pid:longint;Sig:integer):integer;
{ {
Send signal 'sig' to a process, or a group of processes. Send signal 'sig' to a process, or a group of processes.
If Pid > 0 then the signal is sent to pid If Pid > 0 then the signal is sent to pid
pid=-1 to all processes except process 1 pid=-1 to all processes except process 1
pid < -1 to process group -pid pid < -1 to process group -pid
Return value is zero, except for case three, where the return value Return value is zero, except for case three, where the return value
is the number of processes to which the signal was sent. is the number of processes to which the signal was sent.
} }
@ -2540,7 +2540,7 @@ end;
{****************************************************************************** {******************************************************************************
IOCtl and Termios calls IOCtl and Termios calls
******************************************************************************} ******************************************************************************}
Function IOCtl(Handle,Ndx: Longint;Data: Pointer):boolean; Function IOCtl(Handle,Ndx: Longint;Data: Pointer):boolean;
@ -2609,7 +2609,7 @@ begin
with tios do with tios do
begin begin
c_iflag:=c_iflag and (not (IGNBRK or BRKINT or PARMRK or ISTRIP or c_iflag:=c_iflag and (not (IGNBRK or BRKINT or PARMRK or ISTRIP or
INLCR or IGNCR or ICRNL or IXON)); INLCR or IGNCR or ICRNL or IXON));
c_oflag:=c_oflag and (not OPOST); c_oflag:=c_oflag and (not OPOST);
c_lflag:=c_lflag and (not (ECHO or ECHONL or ICANON or ISIG or IEXTEN)); c_lflag:=c_lflag and (not (ECHO or ECHONL or ICANON or ISIG or IEXTEN));
c_cflag:=(c_cflag and (not (CSIZE or PARENB))) or CS8; c_cflag:=(c_cflag and (not (CSIZE or PARENB))) or CS8;
@ -2691,11 +2691,11 @@ Const
dev='/dev'; dev='/dev';
var var
name : string; name : string;
st : stat; st : stat;
mydev, mydev,
myino : longint; myino : longint;
dirstream : pdir; dirstream : pdir;
d : pdirent; d : pdirent;
begin begin
TTYName:=''; TTYName:='';
fstat(handle,st); fstat(handle,st);
@ -2711,14 +2711,14 @@ begin
begin begin
if (d^.ino=myino) then if (d^.ino=myino) then
begin begin
name:=dev+'/'+strpas(@(d^.name)); name:=dev+'/'+strpas(@(d^.name));
fstat(name,st); fstat(name,st);
if (linuxerror=0) and (st.dev=mydev) then if (linuxerror=0) and (st.dev=mydev) then
begin begin
closedir(dirstream); closedir(dirstream);
ttyname:=name; ttyname:=name;
exit; exit;
end; end;
end; end;
d:=Readdir(dirstream); d:=Readdir(dirstream);
end; end;
@ -2738,7 +2738,7 @@ end;
{****************************************************************************** {******************************************************************************
Utility calls Utility calls
******************************************************************************} ******************************************************************************}
Function Octal(l:longint):longint; Function Octal(l:longint):longint;
@ -2795,8 +2795,8 @@ begin
begin begin
while (buf^ in [' ',#8,#10]) do while (buf^ in [' ',#8,#10]) do
begin begin
buf^:=#0; buf^:=#0;
buf:=buf+1; buf:=buf+1;
end; end;
p^:=buf; p^:=buf;
p:=p+4; p:=p+4;
@ -2849,11 +2849,11 @@ Begin
begin begin
j:=i-1; j:=i-1;
while (j>1) and (temp[j]<>'/') do while (j>1) and (temp[j]<>'/') do
dec (j);{temp[1] is always '/'} dec (j);{temp[1] is always '/'}
delete(temp,j,i-j+3); delete(temp,j,i-j+3);
end end
else else
if i=1 then {i=1, so we have temp='/../something', just delete '/../'} if i=1 then {i=1, so we have temp='/../something', just delete '/../'}
delete(temp,1,3); delete(temp,1,3);
until i=0; until i=0;
{ Remove ending /.. } { Remove ending /.. }
@ -2897,20 +2897,20 @@ Begin
Repeat Repeat
p1:=Pos(';',DirList); p1:=Pos(';',DirList);
If p1=0 Then If p1=0 Then
p1:=255; p1:=255;
NewDir:=Copy(DirList,1,P1 - 1); NewDir:=Copy(DirList,1,P1 - 1);
if NewDir[Length(NewDir)]<>'/' then if NewDir[Length(NewDir)]<>'/' then
NewDir:=NewDir+'/'; NewDir:=NewDir+'/';
NewDir:=NewDir+Path; NewDir:=NewDir+Path;
Delete(DirList,1,p1); Delete(DirList,1,p1);
if FStat(NewDir,Info) then if FStat(NewDir,Info) then
Begin Begin
If Pos('./',NewDir)=1 Then If Pos('./',NewDir)=1 Then
Delete(NewDir,1,2); Delete(NewDir,1,2);
{DOS strips off an initial .\} {DOS strips off an initial .\}
End End
Else Else
NewDir:=''; NewDir:='';
Until (DirList='') or (Length(NewDir) > 0); Until (DirList='') or (Length(NewDir) > 0);
FSearch:=NewDir; FSearch:=NewDir;
End; End;
@ -2991,46 +2991,46 @@ Var
Case Pattern[i] of Case Pattern[i] of
'?' : Found:=(j<=LenName); '?' : Found:=(j<=LenName);
'*' : Begin '*' : Begin
{find the next character in pattern, different of ? and *} {find the next character in pattern, different of ? and *}
while Found and (i<LenPat) do while Found and (i<LenPat) do
begin begin
inc(i); inc(i);
case Pattern[i] of case Pattern[i] of
'*' : ; '*' : ;
'?' : begin '?' : begin
inc(j); inc(j);
Found:=(j<=LenName); Found:=(j<=LenName);
end; end;
else else
Found:=false; Found:=false;
end; end;
end; end;
{Now, find in name the character which i points to, if the * or ? {Now, find in name the character which i points to, if the * or ?
wasn't the last character in the pattern, else, use up all the wasn't the last character in the pattern, else, use up all the
chars in name} chars in name}
Found:=true; Found:=true;
if (i<=LenPat) then if (i<=LenPat) then
begin begin
repeat repeat
{find a letter (not only first !) which maches pattern[i]} {find a letter (not only first !) which maches pattern[i]}
while (j<=LenName) and (name[j]<>pattern[i]) do while (j<=LenName) and (name[j]<>pattern[i]) do
inc (j); inc (j);
if (j<LenName) then if (j<LenName) then
begin begin
if DoFnMatch(i+1,j+1) then if DoFnMatch(i+1,j+1) then
begin begin
i:=LenPat; i:=LenPat;
j:=LenName;{we can stop} j:=LenName;{we can stop}
Found:=true; Found:=true;
end end
else else
inc(j);{We didn't find one, need to look further} inc(j);{We didn't find one, need to look further}
end; end;
until (j>=LenName); until (j>=LenName);
end end
else else
j:=LenName;{we can stop} j:=LenName;{we can stop}
end; end;
else {not a wildcard character in pattern} else {not a wildcard character in pattern}
Found:=(j<=LenName) and (pattern[i]=name[j]); Found:=(j<=LenName) and (pattern[i]=name[j]);
end; end;
@ -3110,43 +3110,43 @@ begin
if buffer<>nil then if buffer<>nil then
begin begin
if fnmatch(temp,strpas(@(buffer^.name[0]))) then if fnmatch(temp,strpas(@(buffer^.name[0]))) then
begin begin
{ get memory for pglob } { get memory for pglob }
new(run^.next); new(run^.next);
if run^.next=nil then if run^.next=nil then
begin begin
linuxerror:=Sys_ENOMEM; linuxerror:=Sys_ENOMEM;
globfree(root); globfree(root);
glob:=nil; glob:=nil;
exit; exit;
end end
else else
begin begin
run:=run^.next; run:=run^.next;
run^.next:=nil; run^.next:=nil;
end; end;
{ Get memory for name } { Get memory for name }
getmem(run^.name,strlen(@(buffer^.name[0]))+1); getmem(run^.name,strlen(@(buffer^.name[0]))+1);
if run^.name=nil then if run^.name=nil then
begin begin
linuxerror:=Sys_ENOMEM; linuxerror:=Sys_ENOMEM;
globfree(root); globfree(root);
glob:=nil; glob:=nil;
exit; exit;
end; end;
move(buffer^.name[0],run^.name^,strlen(@(buffer^.name[0]))+1); move(buffer^.name[0],run^.name^,strlen(@(buffer^.name[0]))+1);
end;{ if fnmatch } end;{ if fnmatch }
end { buffer <> nil } end { buffer <> nil }
else else
begin begin
run:=root; run:=root;
if root^.next<>nil then if root^.next<>nil then
root:=root^.next;{ put root on first entry} root:=root^.next;{ put root on first entry}
if run<>nil then if run<>nil then
begin begin
run^.next:=nil; run^.next:=nil;
globfree(run); globfree(run);
end; end;
end; end;
until buffer=nil; until buffer=nil;
if root^.name=nil then if root^.name=nil then
@ -3332,11 +3332,11 @@ Procedure WritePort (Port : Longint; Value : Byte);
Writes 'Value' to port 'Port' Writes 'Value' to port 'Port'
} }
begin begin
asm asm
movl 8(%ebp),%edx movl 8(%ebp),%edx
movb 12(%ebp),%al movb 12(%ebp),%al
outb %al,%dx outb %al,%dx
end; end;
end; end;
Procedure WritePort (Port : Longint; Value : Word); Procedure WritePort (Port : Longint; Value : Word);
@ -3345,11 +3345,11 @@ Procedure WritePort (Port : Longint; Value : Word);
} }
begin begin
asm asm
movl 8(%ebp),%edx movl 8(%ebp),%edx
movw 12(%ebp),%ax movw 12(%ebp),%ax
outw %ax,%dx outw %ax,%dx
end ['EAX','EBX']; end ['EAX','EBX'];
end; end;
@ -3360,11 +3360,11 @@ Procedure WritePort (Port : Longint; Value : Longint);
} }
begin begin
asm asm
movl 8(%ebp),%edx movl 8(%ebp),%edx
movl 12(%ebp),%eax movl 12(%ebp),%eax
outl %eax,%dx outl %eax,%dx
end ['EAX','EBX']; end ['EAX','EBX'];
end; end;
@ -3375,12 +3375,12 @@ Procedure WritePortl (Port : Longint; Var Buf; Count: longint);
} }
begin begin
asm asm
movl 16(%ebp),%ecx movl 16(%ebp),%ecx
movl 12(%ebp),%esi movl 12(%ebp),%esi
movl 8(%ebp),%edx movl 8(%ebp),%edx
cld cld
rep rep
outsl outsl
end ['ECX','ESI','EDX']; end ['ECX','ESI','EDX'];
end; end;
@ -3392,12 +3392,12 @@ Procedure WritePortW (Port : Longint; Var Buf; Count: longint);
} }
begin begin
asm asm
movl 16(%ebp),%ecx movl 16(%ebp),%ecx
movl 12(%ebp),%esi movl 12(%ebp),%esi
movl 8(%ebp),%edx movl 8(%ebp),%edx
cld cld
rep rep
outsw outsw
end ['ECX','ESI','EDX']; end ['ECX','ESI','EDX'];
end; end;
@ -3409,12 +3409,12 @@ Procedure WritePortB (Port : Longint; Var Buf; Count: longint);
} }
begin begin
asm asm
movl 16(%ebp),%ecx movl 16(%ebp),%ecx
movl 12(%ebp),%esi movl 12(%ebp),%esi
movl 8(%ebp),%edx movl 8(%ebp),%edx
cld cld
rep rep
outsb outsb
end ['ECX','ESI','EDX']; end ['ECX','ESI','EDX'];
end; end;
@ -3425,12 +3425,12 @@ Procedure ReadPort (Port : Longint; Var Value : Byte);
Reads 'Value' from port 'Port' Reads 'Value' from port 'Port'
} }
begin begin
asm asm
movl 8(%ebp),%edx movl 8(%ebp),%edx
inb %dx,%al inb %dx,%al
andl $255,%eax andl $255,%eax
movl %eax,12(%ebp) movl %eax,12(%ebp)
end ['EAX','EBX']; end ['EAX','EBX'];
end; end;
@ -3440,12 +3440,12 @@ Procedure ReadPort (Port : Longint; Var Value : Word);
Reads 'Value' from port 'Port' Reads 'Value' from port 'Port'
} }
begin begin
asm asm
movl 8(%ebp),%edx movl 8(%ebp),%edx
inw %dx,%ax inw %dx,%ax
andl $65535,%eax andl $65535,%eax
movl %eax,12(%ebp) movl %eax,12(%ebp)
end ['EAX','EBX']; end ['EAX','EBX'];
end; end;
@ -3455,11 +3455,11 @@ Procedure ReadPort (Port : Longint; Var Value : Longint);
Reads 'Value' from port 'Port' Reads 'Value' from port 'Port'
} }
begin begin
asm asm
movl 8(%ebp),%edx movl 8(%ebp),%edx
inl %dx,%eax inl %dx,%eax
movl %eax,12(%ebp) movl %eax,12(%ebp)
end ['EAX','EBX']; end ['EAX','EBX'];
end; end;
@ -3469,12 +3469,12 @@ Procedure ReadPortL (Port : Longint; Var Buf; Count: longint);
} }
begin begin
asm asm
movl 16(%ebp),%ecx movl 16(%ebp),%ecx
movl 12(%ebp),%edi movl 12(%ebp),%edi
movl 8(%ebp),%edx movl 8(%ebp),%edx
cld cld
rep rep
insl insl
end ['ECX','ESI','EDX']; end ['ECX','ESI','EDX'];
end; end;
@ -3486,12 +3486,12 @@ Procedure ReadPortW (Port : Longint; Var Buf; Count: longint);
} }
begin begin
asm asm
movl 16(%ebp),%ecx movl 16(%ebp),%ecx
movl 12(%ebp),%edi movl 12(%ebp),%edi
movl 8(%ebp),%edx movl 8(%ebp),%edx
cld cld
rep rep
insw insw
end ['ECX','ESI','EDX']; end ['ECX','ESI','EDX'];
end; end;
@ -3503,12 +3503,12 @@ Procedure ReadPortB (Port : Longint; Var Buf; Count: longint);
} }
begin begin
asm asm
movl 16(%ebp),%ecx movl 16(%ebp),%ecx
movl 12(%ebp),%edi movl 12(%ebp),%edi
movl 8(%ebp),%edx movl 8(%ebp),%edx
cld cld
rep rep
insb insb
end ['ECX','ESI','EDX']; end ['ECX','ESI','EDX'];
end; end;
{$ENDIF} {$ENDIF}
@ -3520,7 +3520,10 @@ End.
{ {
$Log$ $Log$
Revision 1.29 1999-02-02 21:19:54 michael Revision 1.30 1999-02-22 10:32:10 pierre
* Dup second arg must be var arg !
Revision 1.29 1999/02/02 21:19:54 michael
Corrected wrong mode error in fdopen Corrected wrong mode error in fdopen
Revision 1.28 1999/01/20 13:29:09 peter Revision 1.28 1999/01/20 13:29:09 peter