mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 23:59:30 +02:00
* remove deprecated CASE node of socket addr (deprecated since 2010)
* remove inactive "legacysocket" 1.0.x functions. Passive for a whole cycle without any questions * remove signed htonl versions. git-svn-id: trunk@29388 -
This commit is contained in:
parent
f2d4792342
commit
ea6894cd14
packages/rtl-extra/src/inc
@ -235,15 +235,6 @@ end;
|
||||
|
||||
type thostaddr= packed array[1..4] of byte;
|
||||
|
||||
function htonl( host : longint):longint; inline;overload;deprecated;
|
||||
begin
|
||||
{$ifdef FPC_BIG_ENDIAN}
|
||||
htonl:=host;
|
||||
{$else}
|
||||
htonl:=SwapEndian(host);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
function htonl( host : cardinal):cardinal; inline;overload;
|
||||
begin
|
||||
{$ifdef FPC_BIG_ENDIAN}
|
||||
@ -253,15 +244,6 @@ begin
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
Function NToHl (Net : longint) : longint; inline;overload;deprecated;
|
||||
begin
|
||||
{$ifdef FPC_BIG_ENDIAN}
|
||||
ntohl:=net;
|
||||
{$else}
|
||||
ntohl:=SwapEndian(net);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
Function NToHl (Net : cardinal) : cardinal; inline;overload;
|
||||
begin
|
||||
{$ifdef FPC_BIG_ENDIAN}
|
||||
|
@ -68,8 +68,6 @@ type
|
||||
|
||||
psockaddr_in = ^sockaddr_in;
|
||||
sockaddr_in = packed record
|
||||
case boolean of
|
||||
false : (
|
||||
{$ifdef SOCK_HAS_SINLEN}
|
||||
sin_len : cuchar;
|
||||
{$endif}
|
||||
@ -77,16 +75,6 @@ type
|
||||
sin_port : cushort;
|
||||
sin_addr : in_addr;
|
||||
xpad : array [0..7] of char; { to get to the size of sockaddr... }
|
||||
);
|
||||
true: (
|
||||
{$ifdef SOCK_HAS_SINLEN}
|
||||
len : cuchar deprecated;
|
||||
{$endif}
|
||||
family : sa_family_t deprecated;
|
||||
port : cushort deprecated;
|
||||
addr : cardinal deprecated;
|
||||
pad : array [0..7] of char deprecated; { to get to the size of sockaddr... }
|
||||
);
|
||||
end;
|
||||
|
||||
TInetSockAddr = sockaddr_in;
|
||||
@ -183,23 +171,6 @@ function fpsocketpair (d:cint; xtype:cint; protocol:cint; sv:pcint):cint;
|
||||
Function CloseSocket(Sock:Longint):Longint;
|
||||
|
||||
{Basic Socket Functions}
|
||||
{$ifdef legacysocket}
|
||||
Function Socket(Domain,SocketType,Protocol:Longint):Longint; deprecated;
|
||||
Function Send(Sock:Longint;Const Buf;BufLen,Flags:Longint):Longint; deprecated;
|
||||
Function SendTo(Sock:Longint;Const Buf;BufLen,Flags:Longint;Var Addr; AddrLen : Longint):Longint; deprecated;
|
||||
Function Recv(Sock:Longint;Var Buf;BufLen,Flags:Longint):Longint; deprecated;
|
||||
Function RecvFrom(Sock : Longint; Var Buf; Buflen,Flags : Longint; Var Addr; var AddrLen : longInt) : longint;deprecated;
|
||||
Function Bind(Sock:Longint;Const Addr;AddrLen:Longint):Boolean;deprecated;
|
||||
Function Listen (Sock,MaxConnect:Longint):Boolean;deprecated;
|
||||
Function Accept(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;deprecated;
|
||||
Function Connect(Sock:Longint;Const Addr;Addrlen:Longint):boolean;deprecated;
|
||||
Function Shutdown(Sock:Longint;How:Longint):Longint;deprecated;
|
||||
Function GetSocketName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;deprecated;
|
||||
Function GetPeerName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;deprecated;
|
||||
Function SetSocketOptions(Sock,Level,OptName:Longint;const OptVal;optlen:longint):Longint;deprecated;
|
||||
Function GetSocketOptions(Sock,Level,OptName:Longint;Var OptVal;Var optlen:longint):Longint;deprecated;
|
||||
Function SocketPair(Domain,SocketType,Protocol:Longint;var Pair:TSockArray):Longint;deprecated;
|
||||
{$endif}
|
||||
|
||||
{ untyped/text filetype support }
|
||||
|
||||
@ -211,8 +182,6 @@ Function Connect(Sock:longint;const addr:TInetSockAddr;var SockIn,SockOut:file):
|
||||
Procedure Sock2File(Sock:Longint;Var SockIn,SockOut:File);deprecated;
|
||||
|
||||
{ Utility routines}
|
||||
function htonl( host : longint):longint; inline; overload;deprecated;
|
||||
Function NToHl( Net : longint):longint; inline; overload;deprecated;
|
||||
function htonl( host : cardinal):cardinal; inline; overload;
|
||||
Function NToHl( Net : cardinal):cardinal; inline; overload;
|
||||
function htons( host : word):word; inline;
|
||||
|
@ -18,85 +18,6 @@
|
||||
Basic Socket Functions
|
||||
******************************************************************************}
|
||||
|
||||
{$ifdef legacysocket}
|
||||
Function socket(Domain,SocketType,Protocol:Longint):Longint;
|
||||
begin
|
||||
Socket:=fpsocket(domain,sockettype,protocol);
|
||||
end;
|
||||
|
||||
|
||||
Function Send(Sock:Longint;Const Buf;BufLen,Flags:Longint):Longint;
|
||||
begin
|
||||
Send:=fpsend(sock,@buf,buflen,flags);
|
||||
end;
|
||||
|
||||
Function SendTo(Sock:Longint;Const Buf;BufLen,Flags:Longint;Var Addr; AddrLen : Longint):Longint;
|
||||
begin
|
||||
Sendto:=fpsendto(sock,@buf,buflen,flags,@addr,addrlen);
|
||||
end;
|
||||
|
||||
Function Recv(Sock:Longint;Var Buf;BufLen,Flags:Longint):Longint;
|
||||
begin
|
||||
Recv:=fprecv(sock,@buf,buflen,flags);
|
||||
end;
|
||||
|
||||
Function RecvFrom(Sock : Longint; Var Buf; Buflen,Flags : Longint; Var Addr ; var AddrLen :longint) : longint;
|
||||
|
||||
begin
|
||||
RecvFrom:=fprecvfrom(Sock,@buf,buflen,flags,@Addr,psocklen(@AddrLen));
|
||||
end;
|
||||
|
||||
Function Bind(Sock:Longint;Const Addr;AddrLen:Longint):Boolean;
|
||||
begin
|
||||
Bind:=fpbind(Sock,@Addr,AddrLen)=0;
|
||||
end;
|
||||
|
||||
Function Listen(Sock,MaxConnect:Longint):Boolean;
|
||||
begin
|
||||
Listen:=fplisten(sock,maxconnect)=0;
|
||||
end;
|
||||
|
||||
Function Accept(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
||||
begin
|
||||
Accept:=fpaccept(sock,@addr,psocklen(@addrlen));
|
||||
end;
|
||||
|
||||
Function Connect(Sock:Longint;Const Addr;Addrlen:Longint): boolean;
|
||||
|
||||
begin
|
||||
Connect:=fpConnect(sock,@addr,addrlen)=0;
|
||||
end;
|
||||
|
||||
Function Shutdown(Sock:Longint;How:Longint):Longint;
|
||||
begin
|
||||
ShutDown:=fpshutdown(sock,how);
|
||||
end;
|
||||
|
||||
Function GetSocketName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
||||
begin
|
||||
GetSocketName:=fpgetsockname(sock,@addr,psocklen(@addrlen));
|
||||
end;
|
||||
|
||||
Function GetPeerName(Sock:Longint;Var Addr;Var Addrlen:Longint):Longint;
|
||||
begin
|
||||
GetPeerName:=fpgetPeerName(sock,@addr,psocklen(@addrlen));
|
||||
end;
|
||||
|
||||
Function SetSocketOptions(Sock,Level,OptName:Longint;const OptVal;optlen:longint):Longint;
|
||||
begin
|
||||
SetSocketOptions:=fpsetsockopt(Sock,Level,OptName,pointer(@OptVal),optlen);
|
||||
end;
|
||||
|
||||
Function GetSocketOptions(Sock,Level,OptName:Longint;Var OptVal;Var optlen:longint):Longint;
|
||||
begin
|
||||
GetSocketOptions:=fpgetsockopt(Sock,Level,OptName,@OptVal,psocklen(@OptLen));
|
||||
end;
|
||||
|
||||
Function SocketPair(Domain,SocketType,Protocol:Longint;var Pair:TSockArray):Longint;
|
||||
begin
|
||||
SocketPair:=fpsocketpair(domain,sockettype,protocol,@pair[1]);
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
{******************************************************************************
|
||||
UnixSock
|
||||
|
Loading…
Reference in New Issue
Block a user