2
0
Эх сурвалжийг харах

* fdset functions renamed to fp<posix name>

marco 22 жил өмнө
parent
commit
61d94af8be

+ 10 - 6
rtl/unix/bunxh.inc

@@ -19,12 +19,13 @@ Type TGrpArr = Array [0..0] of TGid;		{ C style array workarounds}
      TFilDes = Array [0..1] of cInt;
      TFilDes = Array [0..1] of cInt;
      pFilDes = ^TFilDes;
      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  FpsigEmptySet(var nset : TSigSet): cint;
     Function  FpSigFillSet (var nset : TSigSet): cInt;
     Function  FpSigFillSet (var nset : TSigSet): cInt;
     Function  FpSigAddSet  (var nset : TSigSet; signo : cInt): 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$
   $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.
    * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
 
 
   Revision 1.3  2003/06/01 16:28:41  marco
   Revision 1.3  2003/06/01 16:28:41  marco

+ 6 - 3
rtl/unix/bunxovl.inc

@@ -283,8 +283,8 @@ begin
      SetErrNo(ESysEBADF);
      SetErrNo(ESysEBADF);
      exit(-1);
      exit(-1);
    end;
    end;
-  Fpfdemptyset(f);
-  fpfdaddset(f,textrec(T).handle);
+  FpFD_ZERO(f);
+  fpFD_SET(textrec(T).handle,f);
   if textrec(T).mode=fminput then
   if textrec(T).mode=fminput then
    fpselect:=fpselect(textrec(T).handle+1,@f,nil,nil,TimeOut)
    fpselect:=fpselect(textrec(T).handle+1,@f,nil,nil,TimeOut)
   else
   else
@@ -310,7 +310,10 @@ end;
 
 
 {
 {
  $Log$
  $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.
   * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
 
 
  Revision 1.2  2003/06/01 16:28:41  marco
  Revision 1.2  2003/06/01 16:28:41  marco

+ 10 - 7
rtl/unix/crt.pp

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

+ 13 - 10
rtl/unix/genfdset.inc

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

+ 18 - 15
rtl/unix/keyboard.pp

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

+ 6 - 3
rtl/unix/mouse.pp

@@ -344,8 +344,8 @@ begin
    exit(false);
    exit(false);
   if gpm_fs>0 then
   if gpm_fs>0 then
     begin
     begin
-      fpfdemptyset(fds);
-      fpFDaddset(fds,gpm_fs);
+      fpFD_ZERO(fds);
+      fpFD_SET(gpm_fs,fds);
     end;
     end;
   if (fpSelect(gpm_fs+1,@fds,nil,nil,1)>0) then
   if (fpSelect(gpm_fs+1,@fds,nil,nil,1)>0) then
    begin
    begin
@@ -418,7 +418,10 @@ end.
 
 
 {
 {
   $Log$
   $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.
    * Unix reform stage two. Remove all calls from Unix that exist in Baseunix.
 
 
   Revision 1.9  2002/10/14 18:37:15  peter
   Revision 1.9  2002/10/14 18:37:15  peter

+ 6 - 3
rtl/unix/unix.pp

@@ -953,8 +953,8 @@ begin
      LinuxError:=ESysEBADF;
      LinuxError:=ESysEBADF;
      exit(-1);
      exit(-1);
    end;
    end;
-  Fpfdemptyset(f);
-  fpfdaddset(f,textrec(T).handle);
+  FpFD_ZERO(f);
+  fpFD_SET(textrec(T).handle,f);
   if textrec(T).mode=fminput then
   if textrec(T).mode=fminput then
    SelectText:=fpselect(textrec(T).handle+1,@f,nil,nil,TimeOut)
    SelectText:=fpselect(textrec(T).handle+1,@f,nil,nil,TimeOut)
   else
   else
@@ -2155,7 +2155,10 @@ End.
 
 
 {
 {
   $Log$
   $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
    * small fixes. FreeBSD now cycles
 
 
   Revision 1.31  2003/09/14 20:15:01  marco
   Revision 1.31  2003/09/14 20:15:01  marco