more pod patches
[p5sagit/p5-mst-13.2.git] / ext / Socket / Socket.pm
index 3c3380f..344c87d 100644 (file)
@@ -1,7 +1,7 @@
 package Socket;
 
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-$VERSION = "1.7";
+our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
+$VERSION = "1.72";
 
 =head1 NAME
 
@@ -56,7 +56,7 @@ be imported individually, and with the C<:crlf> export tag:
 
 In addition, some structure manipulation functions are available:
 
-=over
+=over 4
 
 =item inet_aton HOSTNAME
 
@@ -111,7 +111,7 @@ to inet_aton('255.255.255.255').
 
 =item sockaddr_in SOCKADDR_IN
 
-In an array context, unpacks its SOCKADDR_IN argument and returns an array
+In a list context, unpacks its SOCKADDR_IN argument and returns an array
 consisting of (PORT, ADDRESS).  In a scalar context, packs its (PORT,
 ADDRESS) arguments as a SOCKADDR_IN and returns it.  If this is confusing,
 use pack_sockaddr_in() and unpack_sockaddr_in() explicitly.
@@ -135,7 +135,7 @@ Will croak if the structure does not have AF_INET in the right place.
 
 =item sockaddr_un SOCKADDR_UN
 
-In an array context, unpacks its SOCKADDR_UN argument and returns an array
+In a list context, unpacks its SOCKADDR_UN argument and returns an array
 consisting of (PATHNAME).  In a scalar context, packs its PATHNAME
 arguments as a SOCKADDR_UN and returns it.  If this is confusing, use
 pack_sockaddr_un() and unpack_sockaddr_un() explicitly.
@@ -160,10 +160,11 @@ have AF_UNIX in the right place.
 =cut
 
 use Carp;
+use warnings::register;
 
 require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
 @EXPORT = qw(
        inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in
        pack_sockaddr_un unpack_sockaddr_un
@@ -193,10 +194,28 @@ require DynaLoader;
        AF_UNIX
        AF_UNSPEC
        AF_X25
+       IOV_MAX
+       MSG_BCAST
+       MSG_CTLFLAGS
+       MSG_CTLIGNORE
+       MSG_CTRUNC
        MSG_DONTROUTE
+       MSG_DONTWAIT
+       MSG_EOF
+       MSG_EOR
+       MSG_ERRQUEUE
+       MSG_FIN
        MSG_MAXIOVLEN
+       MSG_MCAST
+       MSG_NOSIGNAL
        MSG_OOB
        MSG_PEEK
+       MSG_PROXY
+       MSG_RST
+       MSG_SYN
+       MSG_TRUNC
+       MSG_URG
+       MSG_WAITALL
        PF_802
        PF_APPLETALK
        PF_CCITT
@@ -221,6 +240,14 @@ require DynaLoader;
        PF_UNIX
        PF_UNSPEC
        PF_X25
+       SCM_CONNECT
+       SCM_CREDENTIALS
+       SCM_CREDS
+       SCM_RIGHTS
+       SCM_TIMESTAMP
+       SHUT_RD
+       SHUT_RDWR
+       SHUT_WR
        SOCK_DGRAM
        SOCK_RAW
        SOCK_RDM
@@ -241,17 +268,26 @@ require DynaLoader;
        SO_RCVLOWAT
        SO_RCVTIMEO
        SO_REUSEADDR
+       SO_REUSEPORT
        SO_SNDBUF
        SO_SNDLOWAT
        SO_SNDTIMEO
        SO_TYPE
        SO_USELOOPBACK
+       UIO_MAXIOV
 );
 
-@EXPORT_OK = qw(CR LF CRLF $CR $LF $CRLF);
+@EXPORT_OK = qw(CR LF CRLF $CR $LF $CRLF
+
+              IPPROTO_TCP
+              TCP_KEEPALIVE
+              TCP_MAXRT
+              TCP_MAXSEG
+              TCP_NODELAY
+              TCP_STDURG);
 
 %EXPORT_TAGS = (
-    crlf    => [qw(CR LF CRLF $CR $LF $CRLF)]
+    crlf    => [qw(CR LF CRLF $CR $LF $CRLF)],
     all     => [@EXPORT, @EXPORT_OK],
 );
 
@@ -268,7 +304,8 @@ BEGIN {
 sub sockaddr_in {
     if (@_ == 6 && !wantarray) { # perl5.001m compat; use this && die
        my($af, $port, @quad) = @_;
-       carp "6-ARG sockaddr_in call is deprecated" if $^W;
+       warnings::warn "6-ARG sockaddr_in call is deprecated" 
+           if warnings::enabled();
        pack_sockaddr_in($port, inet_aton(join('.', @quad)));
     } elsif (wantarray) {
        croak "usage:   (port,iaddr) = sockaddr_in(sin_sv)" unless @_ == 1;
@@ -289,7 +326,6 @@ sub sockaddr_un {
     }
 }
 
-
 sub AUTOLOAD {
     my($constname);
     ($constname = $AUTOLOAD) =~ s/.*:://;
@@ -298,10 +334,10 @@ sub AUTOLOAD {
        my ($pack,$file,$line) = caller;
        croak "Your vendor has not defined Socket macro $constname, used";
     }
-    eval "sub $AUTOLOAD { $val }";
+    eval "sub $AUTOLOAD () { $val }";
     goto &$AUTOLOAD;
 }
 
-bootstrap Socket $VERSION;
+XSLoader::load 'Socket', $VERSION;
 
 1;