浏览代码

* remove some deprecated functions. Most have alternatives since at least 2.4, and more often 2.2
I left getdomainname in "unix" for now, I don't know the exact status.

git-svn-id: trunk@32255 -

marco 9 年之前
父节点
当前提交
266ebc351b
共有 3 个文件被更改,包括 2 次插入76 次删除
  1. 1 1
      rtl/linux/unxfunc.inc
  2. 1 41
      rtl/unix/unix.pp
  3. 0 34
      rtl/unix/unixutil.pp

+ 1 - 1
rtl/linux/unxfunc.inc

@@ -20,7 +20,7 @@ Function AssignPipe(var pipe_in,pipe_out:cint):cint; [public, alias : 'FPC_SYSC_
   If the operation was unsuccesful, linuxerror is set.
 }
 var
-  pip  : tpipe;
+  pip  : tfildes;
 begin
   {$ifdef FPC_USE_LIBC}
   assignpipe:=pipe(pip);

+ 1 - 41
rtl/unix/unix.pp

@@ -17,7 +17,7 @@ Interface
 
 Uses BaseUnix,UnixType;
 // If you deprecated new symbols, please annotate the version.
-// this makes it easier to 
+// this makes it easier to decide if they can already be removed.
 
 {$if (defined(BSD) or defined(SUNOS)) and defined(FPC_USE_LIBC)}
 {$define USE_VFORK}
@@ -49,16 +49,6 @@ Const
   MAP_TYPE      = baseunix.MAP_TYPE;          { Mask for type of mapping }
   MAP_FIXED     = baseunix.MAP_FIXED;         { Interpret addr exactly }
 
-{ Flags to `msync'.  There is non msync() call in this unit? 
-  Set to deprecated in 2.7.1, see if sb complains}
-  MS_ASYNC        = 1 deprecated;               { Sync memory asynchronously.  }
-  MS_SYNC         = 4 deprecated;               { Synchronous memory sync.  }
-  MS_INVALIDATE   = 2 deprecated;               { Invalidate the caches.  }
-
-Type
-  // deprecated in 2.7.1, no active use, use the baseunix one.
-  Tpipe = baseunix.tfildes deprecated;     // compability.
-
 {** Time/Date Handling **}
 
 var
@@ -88,7 +78,6 @@ function FpExecV  (Const PathName:AnsiString;args:ppchar):cint;
 function FpExecVP (Const PathName:AnsiString;args:ppchar):cint;
 function FpExecVPE(Const PathName:AnsiString;args,env:ppchar):cint;
 
-Function fpSystem(const Command:string):cint; deprecated 'use ansistring version';
 Function fpSystem(const Command:AnsiString):cint;
 
 Function WaitProcess (Pid:cint):cint; 
@@ -101,9 +90,6 @@ Function W_STOPCODE (Signal: Integer): Integer;
 Function  fpFlock   (var T : text;mode : cint) : cint;
 Function  fpFlock   (var F : File;mode : cint) : cint;
 
-Function  SelectText (var T:Text;TimeOut :PTimeVal):cint; deprecated;
-Function  SelectText (var T:Text;TimeOut :cint):cint; deprecated;
-
 {**  Directory Handling  **}
 
 procedure SeekDir(p:pdir;loc:clong);
@@ -133,8 +119,6 @@ Type
 Function  FSearch  (const path:AnsiString;dirlist:Ansistring;CurrentDirStrategy:TFSearchOption):AnsiString;
 Function  FSearch  (const path:AnsiString;dirlist:AnsiString):AnsiString;
 
-procedure SigRaise (sig:integer); deprecated;
-
 {$ifdef FPC_USE_LIBC}
   const clib = 'c';
   {$i unxdeclh.inc}
@@ -338,27 +322,12 @@ End;
 {$ifdef FPC_USE_LIBC}
 function xfpsystem(p:pchar):cint; cdecl; external clib name 'system';
 
-function fpsystem(const Command:string):cint;
-
-var c:array[0..255] of char;
-
-begin
-  move(command[1],c[0],length(command));
-  c[length(command)]:=#0;
-  fpsystem:=xfpsystem(@c);
-end;
-
 Function fpSystem(const Command:AnsiString):cint;
 begin
   fpsystem:=xfpsystem(pchar(command));
 end;
 
 {$else}
-Function fpSystem(const Command:string):cint; // deprecated helper.
-begin
-  fpsystem:=fpsystem(ansistring(command));
-end;
-
 Function fpSystem(const Command:AnsiString):cint;
 var
   pid,savedpid   : cint;
@@ -1153,15 +1122,6 @@ begin
    gethostname:=strpas(@Sysn.nodename[0]);
 end;
 
-{******************************************************************************
-                          Signal handling calls
-******************************************************************************}
-
-procedure SigRaise(sig:integer);
-begin
-  fpKill(fpGetPid,Sig);
-end;
-
 {******************************************************************************
                              Utility calls
 ******************************************************************************}

+ 0 - 34
rtl/unix/unixutil.pp

@@ -30,18 +30,9 @@ interface
 var
   Tzseconds : Longint;
 
-Type
-  ComStr  = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
-  PathStr = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
-  DirStr  = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
-  NameStr = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
-  ExtStr  = String[255] deprecated 'Clean up shortstring use, or use same type from unit dos.';
-
 Function StringToPPChar(S: PChar;ReserveEntries:integer):ppchar;
 Function StringToPPChar(Var S:AnsiString;ReserveEntries:integer):ppchar;
 function ArrayStringToPPchar(const S:Array of AnsiString;reserveentries:Longint):ppchar; // const ?
-Function GetFS(var T:Text):longint; deprecated;
-Function GetFS(Var F:File):longint; deprecated; // use sysutils.getfilehandle
 Function LocalToEpoch(year,month,day,hour,minute,second:Word):Longint;
 Procedure EpochToLocal(epoch:longint;var year,month,day,hour,minute,second:Word);
 Procedure JulianToGregorian(JulianDN:LongInt;Var Year,Month,Day:Word);
@@ -155,29 +146,6 @@ begin
    end;
 end;
 
-Function GetFS (var T:Text):longint;
-{
-  Get File Descriptor of a text file.
-}
-begin
-  if textrec(t).mode=fmclosed then
-   exit(-1)
-  else
-   GETFS:=textrec(t).Handle
-end;
-
-Function GetFS(Var F:File):longint;
-{
-  Get File Descriptor of an unTyped file.
-}
-begin
-  { Handle and mode are on the same place in textrec and filerec. }
-  if filerec(f).mode=fmclosed then
-   exit(-1)
-  else
-   GETFS:=filerec(f).Handle
-end;
-
 Const
 {Date Translation}
   C1970=2440588;
@@ -234,7 +202,6 @@ Begin
                 (LongInt(Hour)*3600)+(Longint(Minute)*60)+Second-TZSeconds;
 End;
 
-
 Function GregorianToJulian(Year,Month,Day:Longint):LongInt;
 Var
   Century,XYear: LongInt;
@@ -250,5 +217,4 @@ Begin
   GregorianToJulian:=((((Month*153)+2) div 5)+Day)+D2+XYear+Century;
 End;
 
-
 end.