home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
WINSOCK.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
16KB
|
546 lines
//----------------------------------------------------------------------------
// WinSock.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: WinSock.pas
//----------------------------------------------------------------------------
#ifndef WinSockHPP
#define WinSockHPP
//----------------------------------------------------------------------------
#include <Windows.hpp>
#include <System.hpp>
#pragma warn -par
#pragma warn -hid
#pragma warn -inl
namespace Winsock
{
//-- type declarations -------------------------------------------------------
typedef char u_char;
typedef Word u_short;
typedef int u_int;
typedef long u_long;
typedef int TSocket;
struct TFDSet;
typedef TFDSet *PFDSet;
#pragma pack(push, 1)
struct TFDSet
{
int fd_count;
int fd_array[64];
} ;
#pragma pack(pop)
#pragma pack(push, 1)
struct TTimeVal
{
long tv_sec;
long tv_usec;
} ;
#pragma pack(pop)
typedef TTimeVal *PTimeVal;
struct THostEnt;
typedef THostEnt *PHostEnt;
#pragma pack(push, 1)
struct THostEnt
{
char *h_name;
char * *h_aliases;
short h_addrtype;
short h_length;
char * *h_addr_list;
} ;
#pragma pack(pop)
struct TNetEnt;
typedef TNetEnt *PNetEnt;
#pragma pack(push, 1)
struct TNetEnt
{
char *n_name;
char * *n_aliases;
short n_addrtype;
long n_net;
} ;
#pragma pack(pop)
struct TServEnt;
typedef TServEnt *PServEnt;
#pragma pack(push, 1)
struct TServEnt
{
char *s_name;
char * *s_aliases;
short s_port;
char *s_proto;
} ;
#pragma pack(pop)
struct TProtoEnt;
typedef TProtoEnt *PProtoEnt;
#pragma pack(push, 1)
struct TProtoEnt
{
char *p_name;
char * *p_aliases;
short p_proto;
} ;
#pragma pack(pop)
#pragma pack(push, 1)
struct SunB
{
char s_b1;
char s_b2;
char s_b3;
char s_b4;
} ;
#pragma pack(pop)
#pragma pack(push, 1)
struct SunW
{
Word s_w1;
Word s_w2;
} ;
#pragma pack(pop)
#pragma pack(push, 1)
struct TInAddr
{
union
{
long S_addr;
SunW S_un_w;
SunB S_un_b;
};
} ;
#pragma pack(pop)
typedef TInAddr *PInAddr;
struct TSockAddrIn;
typedef TSockAddrIn *PSockAddrIn;
#pragma pack(push, 1)
struct TSockAddrIn
{
union
{
struct
{
Word sa_family;
char sa_data[14];
};
struct
{
Word sin_family;
Word sin_port;
TInAddr sin_addr;
char sin_zero[8];
};
};
} ;
#pragma pack(pop)
struct TWSAData;
typedef TWSAData *PWSAData;
#pragma pack(push, 1)
struct TWSAData
{
Word wVersion;
Word wHighVersion;
char szDescription[257];
char szSystemStatus[129];
Word iMaxSockets;
Word iMaxUdpDg;
char *lpVendorInfo;
} ;
#pragma pack(pop)
struct TTransmitFileBuffers;
typedef TTransmitFileBuffers *PTransmitFileBuffers;
#pragma pack(push, 1)
struct TTransmitFileBuffers
{
void *Head;
int HeadLength;
void *Tail;
int TailLength;
} ;
#pragma pack(pop)
typedef TSockAddrIn *PSockAddr;
typedef TSockAddrIn TSockAddr;
#pragma pack(push, 1)
struct TSockProto
{
Word sp_family;
Word sp_protocol;
} ;
#pragma pack(pop)
typedef TSockProto *PSockProto;
#pragma pack(push, 1)
struct TLinger
{
Word l_onoff;
Word l_linger;
} ;
#pragma pack(pop)
typedef TLinger *PLinger;
//-- var, const, procedure ---------------------------------------------------
#define FD_SETSIZE (Byte)(64)
#define IOCPARM_MASK (Byte)(127)
#define IOC_VOID (int)(536870912)
#define IOC_OUT (int)(1073741824)
#define IOC_IN (int)(-2147483648)
#define IOC_INOUT (int)(-1073741824)
#define FIONREAD (int)(1074030207)
#define FIONBIO (int)(-2147195266)
#define FIOASYNC (int)(-2147195267)
#define IPPROTO_IP (Byte)(0)
#define IPPROTO_ICMP (Byte)(1)
#define IPPROTO_GGP (Byte)(2)
#define IPPROTO_TCP (Byte)(6)
#define IPPROTO_PUP (Byte)(12)
#define IPPROTO_UDP (Byte)(17)
#define IPPROTO_IDP (Byte)(22)
#define IPPROTO_ND (Byte)(77)
#define IPPROTO_RAW (Byte)(255)
#define IPPROTO_MAX (Word)(256)
#define IPPORT_ECHO (Byte)(7)
#define IPPORT_DISCARD (Byte)(9)
#define IPPORT_SYSTAT (Byte)(11)
#define IPPORT_DAYTIME (Byte)(13)
#define IPPORT_NETSTAT (Byte)(15)
#define IPPORT_FTP (Byte)(21)
#define IPPORT_TELNET (Byte)(23)
#define IPPORT_SMTP (Byte)(25)
#define IPPORT_TIMESERVER (Byte)(37)
#define IPPORT_NAMESERVER (Byte)(42)
#define IPPORT_WHOIS (Byte)(43)
#define IPPORT_MTP (Byte)(57)
#define IPPORT_TFTP (Byte)(69)
#define IPPORT_RJE (Byte)(77)
#define IPPORT_FINGER (Byte)(79)
#define IPPORT_TTYLINK (Byte)(87)
#define IPPORT_SUPDUP (Byte)(95)
#define IPPORT_EXECSERVER (Word)(512)
#define IPPORT_LOGINSERVER (Word)(513)
#define IPPORT_CMDSERVER (Word)(514)
#define IPPORT_EFSSERVER (Word)(520)
#define IPPORT_BIFFUDP (Word)(512)
#define IPPORT_WHOSERVER (Word)(513)
#define IPPORT_ROUTESERVER (Word)(520)
#define IPPORT_RESERVED (Word)(1024)
#define IMPLINK_IP (Byte)(155)
#define IMPLINK_LOWEXPER (Byte)(156)
#define IMPLINK_HIGHEXPER (Byte)(158)
#define INADDR_ANY (Byte)(0)
#define INADDR_LOOPBACK (int)(2130706433)
#define INADDR_BROADCAST (Shortint)(-1)
#define INADDR_NONE (Shortint)(-1)
#define WSADESCRIPTION_LEN (Word)(256)
#define WSASYS_STATUS_LEN (Byte)(128)
#define IP_OPTIONS (Byte)(1)
#define IP_MULTICAST_IF (Byte)(2)
#define IP_MULTICAST_TTL (Byte)(3)
#define IP_MULTICAST_LOOP (Byte)(4)
#define IP_ADD_MEMBERSHIP (Byte)(5)
#define IP_DROP_MEMBERSHIP (Byte)(6)
#define IP_DEFAULT_MULTICAST_TTL (Byte)(1)
#define IP_DEFAULT_MULTICAST_LOOP (Byte)(1)
#define IP_MAX_MEMBERSHIPS (Byte)(20)
#define INVALID_SOCKET (int)(-1)
#define SOCKET_ERROR (Shortint)(-1)
#define SOCK_STREAM (Byte)(1)
#define SOCK_DGRAM (Byte)(2)
#define SOCK_RAW (Byte)(3)
#define SOCK_RDM (Byte)(4)
#define SOCK_SEQPACKET (Byte)(5)
#define SO_DEBUG (Byte)(1)
#define SO_ACCEPTCONN (Byte)(2)
#define SO_REUSEADDR (Byte)(4)
#define SO_KEEPALIVE (Byte)(8)
#define SO_DONTROUTE (Byte)(16)
#define SO_BROADCAST (Byte)(32)
#define SO_USELOOPBACK (Byte)(64)
#define SO_LINGER (Byte)(128)
#define SO_OOBINLINE (Word)(256)
#define SO_DONTLINGER (int)(65407)
#define SO_SNDBUF (Word)(4097)
#define SO_RCVBUF (Word)(4098)
#define SO_SNDLOWAT (Word)(4099)
#define SO_RCVLOWAT (Word)(4100)
#define SO_SNDTIMEO (Word)(4101)
#define SO_RCVTIMEO (Word)(4102)
#define SO_ERROR (Word)(4103)
#define SO_TYPE (Word)(4104)
#define SO_CONNDATA (Word)(28672)
#define SO_CONNOPT (Word)(28673)
#define SO_DISCDATA (Word)(28674)
#define SO_DISCOPT (Word)(28675)
#define SO_CONNDATALEN (Word)(28676)
#define SO_CONNOPTLEN (Word)(28677)
#define SO_DISCDATALEN (Word)(28678)
#define SO_DISCOPTLEN (Word)(28679)
#define SO_OPENTYPE (Word)(28680)
#define SO_SYNCHRONOUS_ALERT (Byte)(16)
#define SO_SYNCHRONOUS_NONALERT (Byte)(32)
#define SO_MAXDG (Word)(28681)
#define SO_MAXPATHDG (Word)(28682)
#define TCP_NODELAY (Byte)(1)
#define TCP_BSDURGENT (Word)(28672)
#define AF_UNSPEC (Byte)(0)
#define AF_UNIX (Byte)(1)
#define AF_INET (Byte)(2)
#define AF_IMPLINK (Byte)(3)
#define AF_PUP (Byte)(4)
#define AF_CHAOS (Byte)(5)
#define AF_IPX (Byte)(6)
#define AF_NS (Byte)(6)
#define AF_ISO (Byte)(7)
#define AF_OSI (Byte)(7)
#define AF_ECMA (Byte)(8)
#define AF_DATAKIT (Byte)(9)
#define AF_CCITT (Byte)(10)
#define AF_SNA (Byte)(11)
#define AF_DECnet (Byte)(12)
#define AF_DLI (Byte)(13)
#define AF_LAT (Byte)(14)
#define AF_HYLINK (Byte)(15)
#define AF_APPLETALK (Byte)(16)
#define AF_NETBIOS (Byte)(17)
#define AF_VOICEVIEW (Byte)(18)
#define AF_MAX (Byte)(19)
#define PF_UNSPEC (Byte)(0)
#define PF_UNIX (Byte)(1)
#define PF_INET (Byte)(2)
#define PF_IMPLINK (Byte)(3)
#define PF_PUP (Byte)(4)
#define PF_CHAOS (Byte)(5)
#define PF_NS (Byte)(6)
#define PF_IPX (Byte)(6)
#define PF_ISO (Byte)(7)
#define PF_OSI (Byte)(7)
#define PF_ECMA (Byte)(8)
#define PF_DATAKIT (Byte)(9)
#define PF_CCITT (Byte)(10)
#define PF_SNA (Byte)(11)
#define PF_DECnet (Byte)(12)
#define PF_DLI (Byte)(13)
#define PF_LAT (Byte)(14)
#define PF_HYLINK (Byte)(15)
#define PF_APPLETALK (Byte)(16)
#define PF_VOICEVIEW (Byte)(18)
#define PF_MAX (Byte)(19)
#define SOL_SOCKET (int)(65535)
#define SOMAXCONN (Byte)(5)
#define MSG_OOB (Byte)(1)
#define MSG_PEEK (Byte)(2)
#define MSG_DONTROUTE (Byte)(4)
#define MSG_MAXIOVLEN (Byte)(16)
#define MSG_PARTIAL (int)(32768)
#define MAXGETHOSTSTRUCT (Word)(1024)
#define FD_READ (Byte)(1)
#define FD_WRITE (Byte)(2)
#define FD_OOB (Byte)(4)
#define FD_ACCEPT (Byte)(8)
#define FD_CONNECT (Byte)(16)
#define FD_CLOSE (Byte)(32)
#define WSABASEERR (Word)(10000)
#define WSAEINTR (Word)(10004)
#define WSAEBADF (Word)(10009)
#define WSAEACCES (Word)(10013)
#define WSAEFAULT (Word)(10014)
#define WSAEINVAL (Word)(10022)
#define WSAEMFILE (Word)(10024)
#define WSAEWOULDBLOCK (Word)(10035)
#define WSAEINPROGRESS (Word)(10036)
#define WSAEALREADY (Word)(10037)
#define WSAENOTSOCK (Word)(10038)
#define WSAEDESTADDRREQ (Word)(10039)
#define WSAEMSGSIZE (Word)(10040)
#define WSAEPROTOTYPE (Word)(10041)
#define WSAENOPROTOOPT (Word)(10042)
#define WSAEPROTONOSUPPORT (Word)(10043)
#define WSAESOCKTNOSUPPORT (Word)(10044)
#define WSAEOPNOTSUPP (Word)(10045)
#define WSAEPFNOSUPPORT (Word)(10046)
#define WSAEAFNOSUPPORT (Word)(10047)
#define WSAEADDRINUSE (Word)(10048)
#define WSAEADDRNOTAVAIL (Word)(10049)
#define WSAENETDOWN (Word)(10050)
#define WSAENETUNREACH (Word)(10051)
#define WSAENETRESET (Word)(10052)
#define WSAECONNABORTED (Word)(10053)
#define WSAECONNRESET (Word)(10054)
#define WSAENOBUFS (Word)(10055)
#define WSAEISCONN (Word)(10056)
#define WSAENOTCONN (Word)(10057)
#define WSAESHUTDOWN (Word)(10058)
#define WSAETOOMANYREFS (Word)(10059)
#define WSAETIMEDOUT (Word)(10060)
#define WSAECONNREFUSED (Word)(10061)
#define WSAELOOP (Word)(10062)
#define WSAENAMETOOLONG (Word)(10063)
#define WSAEHOSTDOWN (Word)(10064)
#define WSAEHOSTUNREACH (Word)(10065)
#define WSAENOTEMPTY (Word)(10066)
#define WSAEPROCLIM (Word)(10067)
#define WSAEUSERS (Word)(10068)
#define WSAEDQUOT (Word)(10069)
#define WSAESTALE (Word)(10070)
#define WSAEREMOTE (Word)(10071)
#define WSAEDISCON (Word)(10101)
#define WSASYSNOTREADY (Word)(10091)
#define WSAVERNOTSUPPORTED (Word)(10092)
#define WSANOTINITIALISED (Word)(10093)
#define WSAHOST_NOT_FOUND (Word)(11001)
#define HOST_NOT_FOUND (Word)(11001)
#define WSATRY_AGAIN (Word)(11002)
#define TRY_AGAIN (Word)(11002)
#define WSANO_RECOVERY (Word)(11003)
#define NO_RECOVERY (Word)(11003)
#define WSANO_DATA (Word)(11004)
#define NO_DATA (Word)(11004)
#define WSANO_ADDRESS (Word)(11004)
#define NO_ADDRESS (Word)(11004)
#define EWOULDBLOCK (Word)(10035)
#define EINPROGRESS (Word)(10036)
#define EALREADY (Word)(10037)
#define ENOTSOCK (Word)(10038)
#define EDESTADDRREQ (Word)(10039)
#define EMSGSIZE (Word)(10040)
#define EPROTOTYPE (Word)(10041)
#define ENOPROTOOPT (Word)(10042)
#define EPROTONOSUPPORT (Word)(10043)
#define ESOCKTNOSUPPORT (Word)(10044)
#define EOPNOTSUPP (Word)(10045)
#define EPFNOSUPPORT (Word)(10046)
#define EAFNOSUPPORT (Word)(10047)
#define EADDRINUSE (Word)(10048)
#define EADDRNOTAVAIL (Word)(10049)
#define ENETDOWN (Word)(10050)
#define ENETUNREACH (Word)(10051)
#define ENETRESET (Word)(10052)
#define ECONNABORTED (Word)(10053)
#define ECONNRESET (Word)(10054)
#define ENOBUFS (Word)(10055)
#define EISCONN (Word)(10056)
#define ENOTCONN (Word)(10057)
#define ESHUTDOWN (Word)(10058)
#define ETOOMANYREFS (Word)(10059)
#define ETIMEDOUT (Word)(10060)
#define ECONNREFUSED (Word)(10061)
#define ELOOP (Word)(10062)
#define ENAMETOOLONG (Word)(10063)
#define EHOSTDOWN (Word)(10064)
#define EHOSTUNREACH (Word)(10065)
#define ENOTEMPTY (Word)(10066)
#define EPROCLIM (Word)(10067)
#define EUSERS (Word)(10068)
#define EDQUOT (Word)(10069)
#define ESTALE (Word)(10070)
#define EREMOTE (Word)(10071)
extern long __fastcall WSAMakeSyncReply(Word Buflen, Word Error);
extern long __fastcall WSAMakeSelectReply(Word Event, Word Error);
extern Word __fastcall WSAGetAsyncBuflen(long Param);
extern Word __fastcall WSAGetAsyncError(long Param);
extern Word __fastcall WSAGetSelectEvent(long Param);
extern Word __fastcall WSAGetSelectError(long Param);
extern "C" int __stdcall accept(int s, TSockAddrIn &addr, int &addrlen);
extern "C" int __stdcall bind(int s, TSockAddrIn &addr, int namelen);
extern "C" int __stdcall closesocket(int s);
extern "C" int __stdcall connect(int s, TSockAddrIn &name, int namelen);
extern "C" int __stdcall getpeername(int s, TSockAddrIn &name, int &namelen);
extern "C" int __stdcall getsockname(int s, TSockAddrIn &name, int &namelen);
extern "C" int __stdcall getsockopt(int s, int level, int optname, char * optval, int &optlen);
extern "C" long __stdcall htonl(long hostlong);
extern "C" Word __stdcall htons(Word hostshort);
extern "C" long __stdcall inet_addr(char * cp);
extern "C" char * __stdcall inet_ntoa(TInAddr inaddr);
extern "C" int __stdcall ioctlsocket(int s, long cmd, long &arg);
extern "C" int __stdcall listen(int s, int backlog);
extern "C" long __stdcall ntohl(long netlong);
extern "C" Word __stdcall ntohs(Word netshort);
extern "C" int __stdcall recv(int s, void *Buf, int len, int flags);
extern "C" int __stdcall recvfrom(int s, void *Buf, int len, int flags, TSockAddrIn &from, int &fromlen
);
extern "C" long __stdcall select(int nfds, PFDSet readfds, PFDSet writefds, PFDSet exceptfds, PTimeVal
timeout);
extern "C" int __stdcall send(int s, void *Buf, int len, int flags);
extern "C" int __stdcall sendto(int s, void *Buf, int len, int flags, TSockAddrIn &addrto, int tolen
);
extern "C" int __stdcall setsockopt(int s, int level, int optname, char * optval, int optlen);
extern "C" int __stdcall shutdown(int s, int how);
extern "C" int __stdcall socket(int af, int Struct, int protocol);
extern "C" PHostEnt __stdcall gethostbyaddr(void * addr, int len, int Struct);
extern "C" PHostEnt __stdcall gethostbyname(char * name);
extern "C" PProtoEnt __stdcall getprotobyname(char * name);
extern "C" PProtoEnt __stdcall getprotobynumber(int proto);
extern "C" PServEnt __stdcall getservbyname(char * name, char * proto);
extern "C" PServEnt __stdcall getservbyport(int port, char * proto);
extern "C" int __stdcall gethostname(char * name, int len);
extern "C" int __stdcall WSAAsyncSelect(int s, HWND HWindow, int wMsg, long lEvent);
extern "C" int __stdcall WSARecvEx(int s, void *buf, int len, int &flags);
extern "C" int __stdcall WSAAsyncGetHostByAddr(HWND HWindow, int wMsg, char * addr, int len, int Struct
, char * buf, int buflen);
extern "C" int __stdcall WSAAsyncGetHostByName(HWND HWindow, int wMsg, char * name, char * buf, int
buflen);
extern "C" int __stdcall WSAAsyncGetProtoByNumber(HWND HWindow, int wMsg, int number, char * buf, int
buflen);
extern "C" int __stdcall WSAAsyncGetProtoByName(HWND HWindow, int wMsg, char * name, char * buf, int
buflen);
extern "C" int __stdcall WSAAsyncGetServByPort(HWND HWindow, int wMsg, int port, char * proto, char *
buf, int buflen);
extern "C" int __stdcall WSAAsyncGetServByName(HWND HWindow, int wMsg, char * name, char * proto, char *
buf, int buflen);
extern "C" int __stdcall WSACancelAsyncRequest(int hAsyncTaskHandle);
extern "C" void * __stdcall WSASetBlockingHook(void * lpBlockFunc);
extern "C" int __stdcall WSAUnhookBlockingHook(void);
extern "C" int __stdcall WSAGetLastError(void);
extern "C" void __stdcall WSASetLastError(int iError);
extern "C" int __stdcall WSACancelBlockingCall(void);
extern "C" DWord __stdcall WSAIsBlocking(void);
extern "C" int __stdcall WSAStartup(Word wVersionRequired, TWSAData &WSData);
extern "C" int __stdcall WSACleanup(void);
extern "C" DWord __stdcall TransmitFile(int hSocket, int hFile, int nNumberOfBytesToWrite, int nNumberOfBytesPerSend
, Windows::POverlapped lpOverlapped, PTransmitFileBuffers lpTransmitBuffers, int dwReserved);
} /* namespace Winsock */
#pragma warn .par
#pragma warn .hid
#pragma warn .inl
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Winsock;
#endif
//-- end unit ----------------------------------------------------------------
#endif // WinSock