Unit
  IBMTCP32;

{$OrgName+}

Interface

Uses
  kSockDef,
  OS2Def;

{$CDECL+}
Function inet_addr (_s: pChar): ULong;
Function gethostbyname (_HName: PChar): pHostEnt;
Function gethostbyaddr (_HAddr: Pointer; _HAddrLen: LongInt; _HAddrType: ULong): PHostEnt;
Function gethostname (_HName: PChar; _HLength: ULong): ApiRet;
Function getprotobyname (_Name: pChar): pProtoEnt;
Function getservbyname (_Name, _Proto: pChar): pServEnt;
Function lswap (l: LongInt): ULong;
Function bswap (w: SmallInt): UShort;

Function htonl (l: LongInt): LongInt; Inline; Begin htonl := LSwap (l); End;
Function ntohl (l: Long): LongInt; Inline; Begin ntohl := LSwap (l); End;
Function htons (w: SmallInt): SmallInt; Inline; Begin htons := BSwap (w); End;
Function ntohs (w: SmallInt): SmallInt; Inline; Begin ntohs := BSwap (w); End;
{$CDECL-}

Implementation

{$CDECL+}
{$L IBMTCPIP.LIB}

Function inet_addr;       external;
Function gethostbyname;   external;
Function gethostbyaddr;   external;
Function gethostname;     external;
Function getprotobyname;  external;
Function getservbyname;   external;
Function lswap;           external;
Function bswap;           external;
{$CDECL-}

End.
