From: Gurusamy Sarathy Date: Sat, 25 Apr 1998 22:27:19 +0000 (+0000) Subject: [asperl] add AS patch#19 (adds socket layer generation to GenCAPI.pl) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=891fc7f27629745a734e804217bbdaf86146df17;p=p5sagit%2Fp5-mst-13.2.git [asperl] add AS patch#19 (adds socket layer generation to GenCAPI.pl) p4raw-id: //depot/asperl@903 --- diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl index 6a935a9..468a9a3 100644 --- a/win32/GenCAPI.pl +++ b/win32/GenCAPI.pl @@ -891,6 +891,225 @@ long _win32_get_osfhandle(int fd) { return pPerl->piStdIO->GetOSfhandle(fd); } + +u_long _win32_htonl (u_long hostlong) +{ + return pPerl->piSock->Htonl(hostlong); +} + +u_short _win32_htons (u_short hostshort) +{ + return pPerl->piSock->Htons(hostshort); +} + +u_long _win32_ntohl (u_long netlong) +{ + return pPerl->piSock->Ntohl(netlong); +} + +u_short _win32_ntohs (u_short netshort) +{ + return pPerl->piSock->Ntohs(netshort); +} + +unsigned long _win32_inet_addr (const char * cp) +{ + return pPerl->piSock->InetAddr(cp, ErrorNo()); +} + +char * _win32_inet_ntoa (struct in_addr in) +{ + return pPerl->piSock->InetNtoa(in, ErrorNo()); +} + +SOCKET _win32_socket (int af, int type, int protocol) +{ + return pPerl->piSock->Socket(af, type, protocol, ErrorNo()); +} + +int _win32_bind (SOCKET s, const struct sockaddr *addr, int namelen) +{ + return pPerl->piSock->Bind(s, addr, namelen, ErrorNo()); +} + +int _win32_listen (SOCKET s, int backlog) +{ + return pPerl->piSock->Listen(s, backlog, ErrorNo()); +} + +SOCKET _win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen) +{ + return pPerl->piSock->Accept(s, addr, addrlen, ErrorNo()); +} + +int _win32_connect (SOCKET s, const struct sockaddr *name, int namelen) +{ + return pPerl->piSock->Connect(s, name, namelen, ErrorNo()); +} + +int _win32_send (SOCKET s, const char * buf, int len, int flags) +{ + return pPerl->piSock->Send(s, buf, len, flags, ErrorNo()); +} + +int _win32_sendto (SOCKET s, const char * buf, int len, int flags, + const struct sockaddr *to, int tolen) +{ + return pPerl->piSock->Sendto(s, buf, len, flags, to, tolen, ErrorNo()); +} + +int _win32_recv (SOCKET s, char * buf, int len, int flags) +{ + return 0; +} + +int _win32_recvfrom (SOCKET s, char * buf, int len, int flags, + struct sockaddr *from, int * fromlen) +{ + return pPerl->piSock->Recvfrom(s, buf, len, flags, from, fromlen, ErrorNo()); +} + +int _win32_shutdown (SOCKET s, int how) +{ + return pPerl->piSock->Shutdown(s, how, ErrorNo()); +} + +int _win32_closesocket (SOCKET s) +{ + return 0; +} + +int _win32_ioctlsocket (SOCKET s, long cmd, u_long *argp) +{ + return 0; +} + +int _win32_setsockopt (SOCKET s, int level, int optname, + const char * optval, int optlen) +{ + return pPerl->piSock->Setsockopt(s, level, optname, optval, optlen, ErrorNo()); +} + +int _win32_getsockopt (SOCKET s, int level, int optname, char * optval, int *optlen) +{ + return pPerl->piSock->Getsockopt(s, level, optname, optval, optlen, ErrorNo()); +} + +int _win32_getpeername (SOCKET s, struct sockaddr *name, int * namelen) +{ + return pPerl->piSock->Getpeername(s, name, namelen, ErrorNo()); +} + +int _win32_getsockname (SOCKET s, struct sockaddr *name, int * namelen) +{ + return pPerl->piSock->Getsockname(s, name, namelen, ErrorNo()); +} + +int _win32_gethostname (char * name, int namelen) +{ + return pPerl->piSock->Gethostname(name, namelen, ErrorNo()); +} + +struct hostent * _win32_gethostbyname(const char * name) +{ + return pPerl->piSock->Gethostbyname(name, ErrorNo()); +} + +struct hostent * _win32_gethostbyaddr(const char * addr, int len, int type) +{ + return pPerl->piSock->Gethostbyaddr(addr, len, type, ErrorNo()); +} + +struct protoent * _win32_getprotobyname(const char * name) +{ + return pPerl->piSock->Getprotobyname(name, ErrorNo()); +} + +struct protoent * _win32_getprotobynumber(int proto) +{ + return pPerl->piSock->Getprotobynumber(proto, ErrorNo()); +} + +struct servent * _win32_getservbyname(const char * name, const char * proto) +{ + return pPerl->piSock->Getservbyname(name, proto, ErrorNo()); +} + +struct servent * _win32_getservbyport(int port, const char * proto) +{ + return pPerl->piSock->Getservbyport(port, proto, ErrorNo()); +} + +int _win32_select (int nfds, Perl_fd_set *rfds, Perl_fd_set *wfds, Perl_fd_set *xfds, + const struct timeval *timeout) +{ + return pPerl->piSock->Select(nfds, (char*)rfds, (char*)wfds, (char*)xfds, timeout, ErrorNo()); +} + +void _win32_endnetent(void) +{ + pPerl->piSock->Endnetent(ErrorNo()); +} + +void _win32_endhostent(void) +{ + pPerl->piSock->Endhostent(ErrorNo()); +} + +void _win32_endprotoent(void) +{ + pPerl->piSock->Endprotoent(ErrorNo()); +} + +void _win32_endservent(void) +{ + pPerl->piSock->Endservent(ErrorNo()); +} + +struct netent * _win32_getnetent(void) +{ + return pPerl->piSock->Getnetent(ErrorNo()); +} + +struct netent * _win32_getnetbyname(char *name) +{ + return pPerl->piSock->Getnetbyname(name, ErrorNo()); +} + +struct netent * _win32_getnetbyaddr(long net, int type) +{ + return pPerl->piSock->Getnetbyaddr(net, type, ErrorNo()); +} + +struct protoent *_win32_getprotoent(void) +{ + return pPerl->piSock->Getprotoent(ErrorNo()); +} + +struct servent *_win32_getservent(void) +{ + return pPerl->piSock->Getservent(ErrorNo()); +} + +void _win32_sethostent(int stayopen) +{ + pPerl->piSock->Sethostent(stayopen, ErrorNo()); +} + +void _win32_setnetent(int stayopen) +{ + pPerl->piSock->Setnetent(stayopen, ErrorNo()); +} + +void _win32_setprotoent(int stayopen) +{ + pPerl->piSock->Setprotoent(stayopen, ErrorNo()); +} + +void _win32_setservent(int stayopen) +{ + pPerl->piSock->Setservent(stayopen, ErrorNo()); +} } /* extern "C" */ EOCODE @@ -962,6 +1181,51 @@ print HDRFILE <