* fdset functions renamed to fp<posix name>

This commit is contained in:
marco 2003-09-16 16:13:56 +00:00
parent 7acb66b1a3
commit 61d94af8be
7 changed files with 69 additions and 47 deletions

View File

@ -19,12 +19,13 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
TFilDes = Array [0..1] of cInt;
pFilDes = ^TFilDes;
Function fpfdaddset (var nset : TFDSet;fdno:cint): cint;
Function fpfddelset (var nset : TFDSet;fdno:cint): cint;
Function fpfdemptyset (var nset : TFDSet):cint;
Function fpfdfillset (var nset : TFDSet):cint;
Function fpfdismember (const nset : TFDSet;fdno:cint): cint;
Function fpFD_SET (fdno:cint;var nset : TFDSet): cint;
Function fpFD_CLR (fdno:cint;var nset : TFDSet): cint;
Function fpFD_ZERO (var nset : TFDSet):cint;
Function fpFD_ISSET (fdno:cint;const nset : TFDSet): cint;
Function fpfdfillset (var nset : TFDSet):cint;
Function FpsigEmptySet(var nset : TSigSet): cint;
Function FpSigFillSet (var nset : TSigSet): cInt;
Function FpSigAddSet (var nset : TSigSet; signo : cInt): cInt;
@ -117,7 +118,10 @@ Type TGrpArr = Array [0..0] of TGid; { C style array workarounds}
{
$Log$
Revision 1.4 2003-09-14 20:15:01 marco
Revision 1.5 2003-09-16 16:13:56 marco
* fdset functions renamed to fp<posix name>
Revision 1.4 2003/09/14 20:15:01 marco
* Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
Revision 1.3 2003/06/01 16:28:41 marco

View File

@ -283,8 +283,8 @@ begin
SetErrNo(ESysEBADF);
exit(-1);
end;
Fpfdemptyset(f);
fpfdaddset(f,textrec(T).handle);
FpFD_ZERO(f);
fpFD_SET(textrec(T).handle,f);
if textrec(T).mode=fminput then
fpselect:=fpselect(textrec(T).handle+1,@f,nil,nil,TimeOut)
else
@ -310,7 +310,10 @@ end;
{
$Log$
Revision 1.3 2003-09-14 20:15:01 marco
Revision 1.4 2003-09-16 16:13:56 marco
* fdset functions renamed to fp<posix name>
Revision 1.3 2003/09/14 20:15:01 marco
* Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
Revision 1.2 2003/06/01 16:28:41 marco

View File

@ -903,8 +903,8 @@ begin
sysKeyPressed:=true
else
begin
FPfdEmptyset(fdsin);
Fpfdaddset(fdsin,TTYin);
fpFD_ZERO(fdsin);
fpFD_SET(TTYin,fdsin);
sysKeypressed:=(fpSelect(TTYIn+1,@fdsin,nil,nil,0)>0);
end;
end;
@ -931,8 +931,8 @@ Begin
{ Only if none are waiting! (JM) }
if not sysKeyPressed then
begin
Fpfdemptyset (FDS);
fpfdaddset (FDS,0);
FpFD_ZERO (FDS);
fpFD_SET (0,FDS);
fpSelect (1,@FDS,nil,nil,nil);
end;
@ -1581,8 +1581,8 @@ begin
y:=0;
s:=#27'[6n';
fpWrite(0,s[1],length(s));
fpFDemptyset(fds);
fpfdaddset(fds,1);
fpFD_ZERO(fds);
fpFD_SET(1,fds);
if (Select(2,@fds,nil,nil,1000)>0) then
begin
readed:=fpRead(1,buf,sizeof(buf));
@ -1682,7 +1682,10 @@ Finalization
End.
{
$Log$
Revision 1.11 2003-09-14 20:15:01 marco
Revision 1.12 2003-09-16 16:13:56 marco
* fdset functions renamed to fp<posix name>
Revision 1.11 2003/09/14 20:15:01 marco
* Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
Revision 1.10 2002/09/07 16:01:27 peter

View File

@ -15,31 +15,31 @@
**********************************************************************}
function fpfdaddset(var nset : TFDSet;fdno:cint): cint;
function fpFD_SET(fdno:cint;var nset : TFDSet): cint;
Begin
if (fdno<=0) or (fdno > FD_MAXFDSET) Then
exit(-1);
nset[(fdno-1) shr ln2bitsinword]:=nset[(fdno-1) shr ln2bitsinword] OR (1 shl ((fdno-1) and ln2bitmask));
fpfdaddset:=0;
fpFD_SET:=0;
End;
function fpfddelset(var nset : TFDSet;fdno:cint): cint;
function fpFD_CLR(fdno:cint;var nset : TFDSet): cint;
Begin
if (fdno<=0) or (fdno > FD_MAXFDSET) Then
exit(-1);
nset[(fdno-1) shr ln2bitsinword]:=nset[(fdno-1) shr ln2bitsinword] AND NOT (1 shl ((fdno-1) and ln2bitmask));
fpfddelset:=0;
fpFD_CLR:=0;
End;
function fpfdemptyset(var nset : TFDSet):cint;
function fpFD_ZERO(var nset : TFDSet):cint;
var i :longint;
Begin
for i:=0 to wordsinsigset-1 DO nset[i]:=0;
fpfdemptyset:=0;
fpFD_ZERO:=0;
End;
function fpfdfillset(var nset : TFDSet):cint;
@ -51,20 +51,23 @@ Begin
fpfdfillset:=0;
End;
function fpfdismember(const nset : TFDSet;fdno:cint): cint;
function fpFD_ISSET(fdno:cint;const nset : TFDSet): cint;
Begin
if (fdno<=0) or (fdno > FD_MAXFDSET) Then
exit(-1);
if ((nset[(fdno-1) shr ln2bitsinword]) and (1 shl ((fdno-1) and ln2bitmask)))>0 Then
fpfdismember:=1
fpFD_ISSET:=1
else
fpfdismember:=0;
fpFD_ISSET:=0;
End;
{
$Log$
Revision 1.1 2003-09-14 20:16:48 marco
Revision 1.2 2003-09-16 16:13:56 marco
* fdset functions renamed to fp<posix name>
Revision 1.1 2003/09/14 20:16:48 marco
* new files unixreform
Revision 1.3 2003/06/01 16:28:41 marco

View File

@ -289,8 +289,8 @@ begin
sysKeyPressed:=true
else
begin
fpfdemptyset(fdsin);
fpfdaddset(fdsin,StdInputHandle);
fpFD_ZERO(fdsin);
fpFD_SET(StdInputHandle,fdsin);
sysKeypressed:=(fpSelect(StdInputHandle+1,@fdsin,nil,nil,0)>0);
end;
end;
@ -333,8 +333,8 @@ Const
ch : char;
fdsin : tfdSet;
begin
fpfdemptyset(fdsin);
fpfdaddset(fdsin,StdInputHandle);
fpFD_ZERO(fdsin);
fpFD_SET(StdInputHandle,fdsin);
Fillchar(MouseEvent,SizeOf(TMouseEvent),#0);
if InCnt=0 then
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
@ -813,8 +813,8 @@ Begin
{Wait for Key}
if not sysKeyPressed then
begin
fpfdemptyset (fdsin);
fpfdaddSet (fdsin,StdInputHandle);
fpFD_ZERO (fdsin);
fpFD_SET (StdInputHandle,fdsin);
fpSelect (StdInputHandle+1,@fdsin,nil,nil,nil);
end;
RawReadKey:=ttyRecvChar;
@ -828,8 +828,8 @@ Var
St : String;
Begin
St:=RawReadKey;
fpfdemptyset (fdsin);
fpfdaddSet (fdsin,StdInputHandle);
fpFD_ZERO (fdsin);
fpFD_SET (StdInputHandle,fdsin);
Repeat
if InCnt=0 then
fpSelect(StdInputHandle+1,@fdsin,nil,nil,10);
@ -917,8 +917,8 @@ Begin
{Wait for Key}
if not sysKeyPressed then
begin
fpfdemptyset (fdsin);
fpfdaddSet (fdsin,StdInputHandle);
fpFD_ZERO (fdsin);
fpFD_SET (StdInputHandle,fdsin);
fpSelect (StdInputHandle+1,@fdsin,nil,nil,nil);
end;
ch:=ttyRecvChar;
@ -928,8 +928,8 @@ Begin
PushKey(ch)
else
begin
fpfdemptyset(fdsin);
fpfdaddSet(fdsin,StdInputHandle);
fpFD_ZERO(fdsin);
fpFD_SET(StdInputHandle,fdsin);
store[0]:=ch;
arrayind:=1;
while assigned(NPT) and syskeypressed do
@ -983,8 +983,8 @@ Begin
{Esc Found ?}
If (ch=#27) then
begin
fpfdemptyset(fdsin);
fpfdaddSet(fdsin,StdInputHandle);
fpFD_ZERO(fdsin);
fpFD_SET(StdInputHandle,fdsin);
State:=1;
store[0]:=#27;
arrayind:=1;
@ -1532,7 +1532,10 @@ begin
end.
{
$Log$
Revision 1.14 2003-09-14 20:15:01 marco
Revision 1.15 2003-09-16 16:13:56 marco
* fdset functions renamed to fp<posix name>
Revision 1.14 2003/09/14 20:15:01 marco
* Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
Revision 1.13 2003/03/27 12:52:10 armin

View File

@ -344,8 +344,8 @@ begin
exit(false);
if gpm_fs>0 then
begin
fpfdemptyset(fds);
fpFDaddset(fds,gpm_fs);
fpFD_ZERO(fds);
fpFD_SET(gpm_fs,fds);
end;
if (fpSelect(gpm_fs+1,@fds,nil,nil,1)>0) then
begin
@ -418,7 +418,10 @@ end.
{
$Log$
Revision 1.10 2003-09-14 20:15:01 marco
Revision 1.11 2003-09-16 16:13:56 marco
* fdset functions renamed to fp<posix name>
Revision 1.10 2003/09/14 20:15:01 marco
* Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
Revision 1.9 2002/10/14 18:37:15 peter

View File

@ -953,8 +953,8 @@ begin
LinuxError:=ESysEBADF;
exit(-1);
end;
Fpfdemptyset(f);
fpfdaddset(f,textrec(T).handle);
FpFD_ZERO(f);
fpFD_SET(textrec(T).handle,f);
if textrec(T).mode=fminput then
SelectText:=fpselect(textrec(T).handle+1,@f,nil,nil,TimeOut)
else
@ -2155,7 +2155,10 @@ End.
{
$Log$
Revision 1.32 2003-09-15 20:08:49 marco
Revision 1.33 2003-09-16 16:13:56 marco
* fdset functions renamed to fp<posix name>
Revision 1.32 2003/09/15 20:08:49 marco
* small fixes. FreeBSD now cycles
Revision 1.31 2003/09/14 20:15:01 marco