Jelajahi Sumber

* more 1.9.x fixes

marco 21 tahun lalu
induk
melakukan
e35a3f8c65
5 mengubah file dengan 23 tambahan dan 18 penghapusan
  1. 6 5
      docs/linuxex/ex52.pp
  2. 9 9
      docs/linuxex/ex53.pp
  3. 6 2
      docs/linuxex/ex54.pp
  4. 1 1
      docs/linuxex/ex55.pp
  5. 1 1
      docs/linuxex/ex56.pp

+ 6 - 5
docs/linuxex/ex52.pp

@@ -1,11 +1,12 @@
 Program Example52;
 
-{ Program to demonstrate the GetFS function. }
+{ Program to demonstrate the GetFileHandle (was : GetFS) function.
+  In 1.9.x it has been generalised over all platforms }
 
-Uses linux;
+Uses SysUtils;
 
 begin
-  Writeln ('File descriptor of input  ',getfs(input));
-  Writeln ('File descriptor of output ',getfs(output));
-  Writeln ('File descriptor of stderr ',getfs(stderr));
+  Writeln ('File descriptor of input  ',getFileHandle(input));
+  Writeln ('File descriptor of output ',getFileHandle(output));
+  Writeln ('File descriptor of stderr ',getFileHandle(stderr));
 end.

+ 9 - 9
docs/linuxex/ex53.pp

@@ -2,26 +2,26 @@ Program Example53;
 
 { Program to demonstrate the S_ISLNK function. }
 
-Uses linux;
+Uses BaseUnix,Unix;
 
 Var Info : Stat;
 
 begin
-  if LStat (paramstr(1),info) then
+  if fpLStat (paramstr(1),@info)=0 then
     begin
-    if S_ISLNK(info.mode) then 
+    if fpS_ISLNK(info.st_mode) then 
       Writeln ('File is a link');
-    if S_ISREG(info.mode) then 
+    if fpS_ISREG(info.st_mode) then 
       Writeln ('File is a regular file');
-    if S_ISDIR(info.mode) then 
+    if fpS_ISDIR(info.st_mode) then 
       Writeln ('File is a directory');
-    if S_ISCHR(info.mode) then 
+    if fpS_ISCHR(info.st_mode) then 
       Writeln ('File is a character device file');
-    if S_ISBLK(info.mode) then 
+    if fpS_ISBLK(info.st_mode) then 
       Writeln ('File is a block device file');
-    if S_ISFIFO(info.mode) then 
+    if fpS_ISFIFO(info.st_mode) then 
       Writeln ('File is a named pipe (FIFO)');
-    if S_ISSOCK(info.mode) then 
+    if fpS_ISSOCK(info.st_mode) then 
       Writeln ('File is a socket');
     end;
 end.

+ 6 - 2
docs/linuxex/ex54.pp

@@ -1,13 +1,17 @@
 Program Example54;
 
-uses Linux;
+uses BaseUnix,Termio;
 
 { Program to demonstrate the IOCtl function. }
 
 var
   tios : Termios;
+
 begin
-  IOCtl(1,TCGETS,@tios);
+  {$ifdef FreeBSD}
+    fpIOCtl(1,TIOCGETA,@tios);	// these constants are very OS dependant.
+				// see the tcgetattr example for a better way
+  {$endif}
   WriteLn('Input Flags  : $',hexstr(tios.c_iflag,8));
   WriteLn('Output Flags : $',hexstr(tios.c_oflag,8));
   WriteLn('Line Flags   : $',hexstr(tios.c_lflag,8));

+ 1 - 1
docs/linuxex/ex55.pp

@@ -1,6 +1,6 @@
 Program Example55;
 
-uses Linux;
+uses TermIO;
 
 { Program to demonstrate the TCGetAttr/TCSetAttr/CFMakeRaw functions. }
 

+ 1 - 1
docs/linuxex/ex56.pp

@@ -1,6 +1,6 @@
 program example56;
 
-uses linux;
+uses Unix;
 
 { Program to demonstrate the Shell function }