Ver Fonte

* replaced some Longints with Cardinals, to mach the C headers
* updated the termios record

sg há 23 anos atrás
pai
commit
a2b52783db
3 ficheiros alterados com 26 adições e 18 exclusões
  1. 8 8
      rtl/linux/termios.inc
  2. 9 5
      rtl/unix/linux.pp
  3. 9 5
      rtl/unix/unix.pp

+ 8 - 8
rtl/linux/termios.inc

@@ -4,7 +4,7 @@
 
 Const
   { Amount of Control Chars }
-  NCCS = 19;
+  NCCS = 32;
   NCC = 8;
 
 {$Ifndef BSD}
@@ -92,22 +92,22 @@ Type
   end;
   TTermio=Termio;
 
-  Termios = packed record
+{$PACKRECORDS C}
+  Termios = record
     c_iflag,
     c_oflag,
     c_cflag,
-    c_lflag  : longint;
+    c_lflag  : cardinal;
     c_line   : char;
     c_cc     : array[0..NCCS-1] of byte;
-   {$IFDEF BSD}
     c_ispeed,
-    c_ospeed : longint; 
-   {$endif}
+    c_ospeed : cardinal; 
   end;
   TTermios=Termios;
+{$PACKRECORDS Default}
 
-const
-  InitCC:array[0..NCCS-1] of byte=(3,34,177,25,4,0,1,0,21,23,32,0,22,17,27,26,0,0,0);
+{const
+  InitCC:array[0..NCCS-1] of byte=(3,34,177,25,4,0,1,0,21,23,32,0,22,17,27,26,0,0,0);}
 
 const
 {c_cc characters}

+ 9 - 5
rtl/unix/linux.pp

@@ -379,8 +379,8 @@ Function NanoSleep(const req : timespec;var rem : timespec) : longint;
 Function  IOCtl(Handle,Ndx: Longint;Data: Pointer):boolean;
 Function  TCGetAttr(fd:longint;var tios:TermIOS):boolean;
 Function  TCSetAttr(fd:longint;OptAct:longint;const tios:TermIOS):boolean;
-Procedure CFSetISpeed(var tios:TermIOS;speed:Longint);
-Procedure CFSetOSpeed(var tios:TermIOS;speed:Longint);
+Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
+Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
 Procedure CFMakeRaw(var tios:TermIOS);
 Function  TCSendBreak(fd,duration:longint):boolean;
 Function  TCSetPGrp(fd,id:longint):boolean;
@@ -2021,7 +2021,7 @@ end;
 
 
 
-Procedure CFSetISpeed(var tios:TermIOS;speed:Longint);
+Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
 begin
  {$ifndef BSD}
   tios.c_cflag:=(tios.c_cflag and (not CBAUD)) or speed;
@@ -2032,7 +2032,7 @@ end;
 
 
 
-Procedure CFSetOSpeed(var tios:TermIOS;speed:Longint);
+Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
 begin
   {$ifndef BSD}
    CFSetISpeed(tios,speed);
@@ -3032,7 +3032,11 @@ End.
 
 {
   $Log$
-  Revision 1.21  2002-03-06 11:34:04  michael
+  Revision 1.22  2002-08-06 13:30:46  sg
+  * replaced some Longints with Cardinals, to mach the C headers
+  * updated the termios record
+
+  Revision 1.21  2002/03/06 11:34:04  michael
   + Forgot to patch linux.pp
 
   Revision 1.20  2002/01/02 12:22:54  marco

+ 9 - 5
rtl/unix/unix.pp

@@ -373,8 +373,8 @@ Function NanoSleep(const req : timespec;var rem : timespec) : longint;
 Function  IOCtl(Handle,Ndx: Longint;Data: Pointer):boolean;
 Function  TCGetAttr(fd:longint;var tios:TermIOS):boolean;
 Function  TCSetAttr(fd:longint;OptAct:longint;const tios:TermIOS):boolean;
-Procedure CFSetISpeed(var tios:TermIOS;speed:Longint);
-Procedure CFSetOSpeed(var tios:TermIOS;speed:Longint);
+Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
+Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
 Procedure CFMakeRaw(var tios:TermIOS);
 Function  TCSendBreak(fd,duration:longint):boolean;
 Function  TCSetPGrp(fd,id:longint):boolean;
@@ -2051,7 +2051,7 @@ end;
 
 
 
-Procedure CFSetISpeed(var tios:TermIOS;speed:Longint);
+Procedure CFSetISpeed(var tios:TermIOS;speed:Cardinal);
 begin
  {$ifndef BSD}
   tios.c_cflag:=(tios.c_cflag and (not CBAUD)) or speed;
@@ -2062,7 +2062,7 @@ end;
 
 
 
-Procedure CFSetOSpeed(var tios:TermIOS;speed:Longint);
+Procedure CFSetOSpeed(var tios:TermIOS;speed:Cardinal);
 begin
   {$ifndef BSD}
    CFSetISpeed(tios,speed);
@@ -3058,7 +3058,11 @@ End.
 
 {
   $Log$
-  Revision 1.22  2002-03-05 20:04:25  michael
+  Revision 1.23  2002-08-06 13:30:46  sg
+  * replaced some Longints with Cardinals, to mach the C headers
+  * updated the termios record
+
+  Revision 1.22  2002/03/05 20:04:25  michael
   + Patch from Sebastian for FCNTL call
 
   Revision 1.21  2002/01/02 12:22:54  marco