diff options
author | Larry Wall <lwall@scalpel.netlabs.com> | 1995-11-21 10:01:00 +1200 |
---|---|---|
committer | Larry <lwall@scalpel.netlabs.com> | 1995-11-21 10:01:00 +1200 |
commit | 4633a7c4bad06b471d9310620b7fe8ddd158cccd (patch) | |
tree | 37ebeb26a64f123784fd8fac6243b124767243b0 /vms/sockadapt.h | |
parent | 8e07c86ebc651fe92eb7e3b25f801f57cfb8dd6f (diff) | |
download | perl-4633a7c4bad06b471d9310620b7fe8ddd158cccd.tar.gz |
5.002 beta 1
If you're adventurous, have a look at
ftp://ftp.sems.com/pub/outgoing/perl5.0/perl5.002beta1.tar.gz
Many thanks to Andy for doing the integration.
Obviously, if you consult the bugs database, you'll note there are
still plenty of buglets that need fixing, and several enhancements that
I've intended to put in still haven't made it in (Hi, Tim and Ilya).
But I think it'll be pretty stable. And you can start to fiddle around
with prototypes (which are, of course, still totally undocumented).
Packrats, don't worry too much about readvertising this widely.
Nowadays we're on a T1 here, so our bandwidth is okay.
Have the appropriate amount of jollity.
Larry
Diffstat (limited to 'vms/sockadapt.h')
-rw-r--r-- | vms/sockadapt.h | 83 |
1 files changed, 81 insertions, 2 deletions
diff --git a/vms/sockadapt.h b/vms/sockadapt.h index 0d56285750..18f4002f12 100644 --- a/vms/sockadapt.h +++ b/vms/sockadapt.h @@ -2,7 +2,7 @@ * * Authors: Charles Bailey bailey@genetics.upenn.edu * David Denholm denholm@conmat.phys.soton.ac.uk - * Last Revised: 24-Feb-1995 + * Last Revised: 17-Mar-1995 * * This file should include any other header files and procide any * declarations, typedefs, and prototypes needed by perl for TCP/IP @@ -11,7 +11,18 @@ * This version is set up for perl5 with socketshr 0.9D TCP/IP support. */ -#include <socketshr.h> +/* SocketShr doesn't support these routines, but the DECC RTL contains + * stubs with these names, designed to be used with the UCX socket + * library. We avoid linker collisions by substituting new names. + */ +#define getnetbyaddr no_getnetbyaddr +#define getnetbyname no_getnetbyname +#define getnetent no_getnetent +#define setnetent no_setnetent +#define endnetent no_endnetent + + +#ifdef __GNU_CC__ /* we may not have netdb.h etc, so lets just do this here - div */ /* no harm doing this for all .c files - needed only by pp_sys.c */ @@ -50,6 +61,16 @@ struct sockaddr { char sa_data[14]; /* up to 14 bytes of direct address */ }; +/* + * Socket address, internet style. + */ +struct sockaddr_in { + short sin_family; + unsigned short sin_port; + struct in_addr sin_addr; + char sin_zero[8]; +}; + struct timeval { long tv_sec; long tv_usec; @@ -61,3 +82,61 @@ struct netent { int n_addrtype; long n_net; }; + +/* Since socketshr.h won't declare function prototypes unless it thinks + * the system headers have already been included, we convince it that + * this is the case. + */ + +#ifndef AF_INET +# define AF_INET 2 +#endif +#ifndef IPPROTO_TCP +# define IPPROTO_TCP 6 +#endif +#ifndef __INET_LOADED +# define __INET_LOADED +#endif +#ifndef __NETDB_LOADED +# define __NETDB_LOADED +#endif + +/* Finally, we provide prototypes for routines not supported by SocketShr, + * so that the stubs in sockadapt.c won't cause complaints about + * undeclared routines. + */ + +struct netent *getnetbyaddr( long net, int type); +struct netent *getnetbyname( char *name); +struct netent *getnetent(); +void setnetent(); +void endnetent(); + +#else /* !__GNU_CC__ */ + +/* DECC and VAXC have socket headers in the system set; they're for UCX, but + * we'll assume that the actual calling sequence is identical across the + * various TCP/IP stacks; these routines are pretty standard. + */ +#include <socket.h> +#include <in.h> +#include <inet.h> +#include <netdb.h> +/* However, we don't have these two in the system headers. */ +void setnetent(); +void endnetent(); + +#endif + +#include <socketshr.h> +/* socketshr.h from SocketShr 0.9D doesn't alias fileno; it's comments say + * that the CRTL version works OK. This isn't the case, at least with + * VAXC, so we use the SocketShr version. + * N.B. This means that sockadapt.h must be included *after* stdio.h. + * This is presently the case for Perl. + */ +#ifdef fileno +# undef fileno +#endif +#define fileno si_fileno +int si_fileno(FILE *); |