marco 21 gadi atpakaļ
vecāks
revīzija
7dcad07b60

+ 1 - 1
docs/linuxex/ex39.pp

@@ -2,7 +2,7 @@ Program Example39;
 
 { Program to demonstrate the GetDomainName function. }
 
-Uses linux;
+Uses Unix;
 
 begin
   Writeln ('Domain name of this machine is : ',GetDomainName);

+ 1 - 1
docs/linuxex/ex40.pp

@@ -2,7 +2,7 @@ Program Example40;
 
 { Program to demonstrate the GetHostName function. }
 
-Uses linux;
+Uses unix;
 
 begin
   Writeln ('Name of this machine is : ',GetHostName);

+ 2 - 2
docs/linuxex/ex41.pp

@@ -2,8 +2,8 @@ Program Example41;
 
 { Program to demonstrate the GetEnv function. }
 
-Uses linux;
+Uses BaseUnix;
 
 begin
-  Writeln ('Path is : ',Getenv('PATH'));
+  Writeln ('Path is : ',fpGetenv('PATH'));
 end.

+ 4 - 0
docs/linuxex/ex42.pp

@@ -2,11 +2,14 @@ Program Example42;
 
 { Program to demonstrate the SysInfo function. }
 
+{$ifdef Linux}	// is Linux specific.
 Uses linux;
 
 Var Info : TSysinfo;
+{$endif}
 
 begin
+{$ifdef Linux}
   If SysInfo (Info) then
     With info do
       begin
@@ -19,4 +22,5 @@ begin
       Writeln ('Free swap     : ',FreeSwap  Div 1024,'Kb.');
       Writeln ('No. Processes : ',procs);
       end;
+  {$endif}
 end.

+ 4 - 2
docs/linuxex/ex43.pp

@@ -2,12 +2,12 @@ Program Example43;
 
 { Program to demonstrate the Uname function. }
 
-Uses linux;
+Uses BaseUnix;
 
 Var UN : utsname;
 
 begin
-  if Uname (UN) then
+  if fpUname (UN)=0 then
     With UN do
       begin
       Writeln ('Name       : ',pchar(@sysname[0]));
@@ -15,6 +15,8 @@ begin
       Writeln ('release    : ',pchar(@Release[0]));
       Writeln ('Version    : ',pchar(@Version[0]));
       Writeln ('Machine    : ',pchar(@Machine[0]));
+{$ifdef Linux} // linuxism
       Writeln ('Domainname : ',pchar(@domainname[0]));
+{$endif}
       end;
 end.

+ 2 - 2
docs/linuxex/ex44.pp

@@ -2,8 +2,8 @@ Program Example44;
 
 { Program to demonstrate the Octal function. }
 
-Uses linux;
 
 begin
-  Writeln ('Octal(666) : ',octal(666));
+//  Writeln ('Octal(666) : ',octal(666));
+  Writeln (' &666      : ',&666);		// 1.9.x+ functionality, octal is not necessary anymore
 end.

+ 1 - 1
docs/linuxex/ex45.pp

@@ -2,7 +2,7 @@ Program Example45;
 
 { Program to demonstrate the FExpand function. }
 
-Uses linux;
+Uses Unix;
 
 begin
   Writeln ('This program is in : ',FExpand(Paramstr(0)));

+ 2 - 2
docs/linuxex/ex46.pp

@@ -2,8 +2,8 @@ Program Example46;
 
 { Program to demonstrate the FSearch function. }
 
-Uses linux,strings;
+Uses BaseUnix, Unix, Strings;
 
 begin
-  Writeln ('ls is in : ',FSearch ('ls',strpas(Getenv('PATH'))));
+  Writeln ('ls is in : ',FSearch ('ls',strpas(fpGetenv('PATH'))));
 end.

+ 1 - 1
docs/linuxex/ex47.pp

@@ -2,7 +2,7 @@ Program Example47;
 
 { Program to demonstrate the DirName function. }
 
-Uses linux;
+Uses Unix,UnixUtil;
 
 Var S : String;
 

+ 1 - 1
docs/linuxex/ex48.pp

@@ -2,7 +2,7 @@ Program Example48;
 
 { Program to demonstrate the BaseName function. }
 
-Uses linux;
+Uses Unix,UnixUtil;
 
 Var S : String;
 

+ 2 - 2
docs/linuxex/ex49.pp

@@ -2,13 +2,13 @@ Program Example49;
 
 { Program to demonstrate the Glob and GlobFree functions. }
 
-Uses linux;
+Uses BaseUnix,Unix;
 
 Var G1,G2 : PGlob;
 
 begin
   G1:=Glob ('*');
-  if LinuxError=0 then
+  if fpgeterrno=0 then
     begin
     G2:=G1;
     Writeln ('Files in this directory : ');

+ 5 - 4
docs/linuxex/ex51.pp

@@ -1,15 +1,16 @@
 Program Example51;
 
-{ Program to demonstrate the StringToPPChar function. }
+{ Program to demonstrate the StringToPPChar function.
+  This function is pretty obsolete }
 
-Uses linux;
+Uses UnixUtil;
 
 var P : PPChar;
     S : String;
 begin
   S:='/bin/ls -l -F';
-  P:=StringToPPChar(S);
+  P:=StringToPPChar(S,0);
   Writeln ('Name     : ',p^); inc(longint(p),4);
   writeln ('Option 1 : ',p^); inc(longint(p),4);
   writeln ('Option 2 : ',p^);
-  end.
+end.