about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/www_tcp.h
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2004-05-07 01:13:29 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2004-05-07 01:13:29 -0400
commitd326f24d169154673717129098ff4554a673f178 (patch)
tree7229f817b10bcdb82f8df2b6af3a3acc792a762d /WWW/Library/Implementation/www_tcp.h
parent2cd8e80bfe2792ce8999a26b34384598f58e3889 (diff)
downloadlynx-snapshots-d326f24d169154673717129098ff4554a673f178.tar.gz
snapshot of project "lynx", label v2-8-6dev_3
Diffstat (limited to 'WWW/Library/Implementation/www_tcp.h')
-rw-r--r--WWW/Library/Implementation/www_tcp.h164
1 files changed, 81 insertions, 83 deletions
diff --git a/WWW/Library/Implementation/www_tcp.h b/WWW/Library/Implementation/www_tcp.h
index 56f00cf7..31b5acde 100644
--- a/WWW/Library/Implementation/www_tcp.h
+++ b/WWW/Library/Implementation/www_tcp.h
@@ -38,22 +38,22 @@ Default values
 
  */
 /* Default values of those: */
-#define NETCLOSE close      /* Routine to close a TCP-IP socket         */
-#define NETREAD  HTDoRead       /* Routine to read from a TCP-IP socket     */
-#define NETWRITE write      /* Routine to write to a TCP-IP socket      */
-#define SOCKET_READ read    /* normal socket read routine */
-#define IOCTL ioctl	    /* normal ioctl routine for sockets */
-#define SOCKET_ERRNO errno	    /* normal socket errno */
+#define NETCLOSE close		/* Routine to close a TCP-IP socket         */
+#define NETREAD  HTDoRead	/* Routine to read from a TCP-IP socket     */
+#define NETWRITE write		/* Routine to write to a TCP-IP socket      */
+#define SOCKET_READ read	/* normal socket read routine */
+#define IOCTL ioctl		/* normal ioctl routine for sockets */
+#define SOCKET_ERRNO errno	/* normal socket errno */
 
 /* Unless stated otherwise, */
-#define SELECT                  /* Can handle >1 channel.               */
-#define GOT_SYSTEM              /* Can call shell with string           */
+#define SELECT			/* Can handle >1 channel.               */
+#define GOT_SYSTEM		/* Can call shell with string           */
 
 #ifdef UNIX
 #define GOT_PIPE
 #endif /* UNIX */
 
-#define INVSOC (-1)             /* Unix invalid socket */
+#define INVSOC (-1)		/* Unix invalid socket */
 		/* NB: newer libwww has something different for Windows */
 
 #ifndef VMS
@@ -126,7 +126,7 @@ Default values
 #endif
 
 #ifdef HAVE_STRING_H
-#include <string.h>             /* For bzero etc */
+#include <string.h>		/* For bzero etc */
 #endif /* HAVE_STRING_H */
 
 /*
@@ -135,29 +135,30 @@ Default values
 
  */
 #ifndef TOASCII
-#ifdef EBCDIC  /* S/390 -- gil -- 1327 */
+#ifdef EBCDIC			/* S/390 -- gil -- 1327 */
 
-extern       char un_IBM1047[];
+extern char un_IBM1047[];
 extern unsigned char IBM1047[];
+
 /* For debugging
 #include <assert.h>
 #define   TOASCII(c) (assert((c)>=0 && (c)<256), un_IBM1047[c])
-*/ /* for production */
+*//* for production */
 #define   TOASCII(c) (un_IBM1047[c])
 
 #define FROMASCII(c) (IBM1047[c])
 
-#else  /* EBCDIC */
+#else /* EBCDIC */
 
 #if '0' != 48
- error Host character set is not ASCII.
+error Host character set is not ASCII.
 #endif
 
 #define TOASCII(c) (c)
 #define FROMASCII(c) (c)
 
-#endif /* EBCDIC */
-#endif /* !TOASCII */
+#endif				/* EBCDIC */
+#endif				/* !TOASCII */
 
 /* convert a char to an unsigned, needed if we have signed characters for ctype.h */
 #define UCH(ch) ((unsigned char)(ch))
@@ -174,15 +175,16 @@ IBM-PC running Windows NT
 #define _WINDOWS_NSL
 #endif
 
-#include <fcntl.h>                      /* For HTFile.c */
-#include <sys\types.h>                  /* For HTFile.c */
-#include <sys\stat.h>                   /* For HTFile.c */
+#include <fcntl.h>		/* For HTFile.c */
+#include <sys\types.h>		/* For HTFile.c */
+#include <sys\stat.h>		/* For HTFile.c */
 #undef NETREAD
 #undef NETWRITE
 #undef NETCLOSE
 #undef IOCTL
 extern int ws_netread(int fd, char *buf, int len);
-#define NETREAD(s,b,l)  ws_netread((s),(b),(l))	/* 1997/11/06 (Thu) */
+
+#define NETREAD(s,b,l)  ws_netread((s),(b),(l))		/* 1997/11/06 (Thu) */
 #define NETWRITE(s,b,l) send((s),(b),(l),0)
 #define NETCLOSE(s)     closesocket(s)
 #define IOCTL				ioctlsocket
@@ -217,7 +219,7 @@ extern int ws_netread(int fd, char *buf, int len);
 #else /* USE_WINSOCK_H */
 
 #include <winsock.h>
-typedef struct sockaddr_in SockA;  /* See netinet/in.h */
+typedef struct sockaddr_in SockA;	/* See netinet/in.h */
 
 #if defined(_MSC_VER) || defined(__MINGW32__)
 #undef EINTR
@@ -233,16 +235,14 @@ typedef struct sockaddr_in SockA;  /* See netinet/in.h */
 #define ECONNRESET           (WSABASEERR+54)
 #define ETIMEDOUT             WSAETIMEDOUT	/* 1997/11/10 (Mon) */
 
-#undef  SOCKET_ERRNO	/* 1997/10/19 (Sun) 18:01:46 */
+#undef  SOCKET_ERRNO		/* 1997/10/19 (Sun) 18:01:46 */
 #define SOCKET_ERRNO          WSAGetLastError()
 
-#endif	/* USE_WINSOCK_H */
+#endif /* USE_WINSOCK_H */
 
 #define INCLUDES_DONE
 #define TCP_INCLUDES_DONE
-#endif  /* WINDOWS */
-
-
+#endif /* WINDOWS */
 
 /*
 
@@ -281,8 +281,8 @@ VAX/VMS
 #define NETWRITE(s,b,l) ((s)>10 ? netwrite((s),(b),(l)) : write((s),(b),(l)))
 #define NETCLOSE(s)     ((s)>10 ? netclose(s) : close(s))
 #undef IOCTL
-#define IOCTL(a,b,c) -1 /* disables ioctl function	      */
-#define NO_IOCTL	/* flag to check if ioctl is disabled */
+#define IOCTL(a,b,c) -1		/* disables ioctl function            */
+#define NO_IOCTL		/* flag to check if ioctl is disabled */
 #endif /* WIN_TCP */
 
 #ifdef CMU_TCP
@@ -303,11 +303,11 @@ VAX/VMS
 #undef IOCTL
 #undef SOCKET_ERRNO
 /*
-**  Delete these socket_foo() prototypes as MultiNet adds them
-**  to it's socket library headers.  Compiler warnings due to
-**  the absence of arguments in the generic prototypes here will
-**  include the names of those which can be deleted. - FM
-*/
+ *  Delete these socket_foo() prototypes as MultiNet adds them
+ *  to it's socket library headers.  Compiler warnings due to
+ *  the absence of arguments in the generic prototypes here will
+ *  include the names of those which can be deleted. - FM
+ */
 extern int socket_read();
 extern int socket_write();
 extern int socket_close();
@@ -347,15 +347,15 @@ extern int socket_ioctl();
 
 #define INCLUDES_DONE
 
-#ifdef MULTINET  /* Include from standard Multinet directories */
+#ifdef MULTINET			/* Include from standard Multinet directories */
 /*
-**  Delete any of these multinet_foo() and associated prototypes
-**  as MultiNet adds them to its socket library headers.  You'll
-**  get compiler warnings about them, due the absence of arguments
-**  in the generic prototyping here, and the warnings will include
-**  the names of the functions whose prototype entries can be
-**  deleted here. - FM
-*/
+ *  Delete any of these multinet_foo() and associated prototypes
+ *  as MultiNet adds them to its socket library headers.  You'll
+ *  get compiler warnings about them, due the absence of arguments
+ *  in the generic prototyping here, and the warnings will include
+ *  the names of the functions whose prototype entries can be
+ *  deleted here. - FM
+ */
 extern int multinet_accept();
 extern int multinet_bind();
 extern int multinet_connect();
@@ -392,7 +392,7 @@ extern char *vms_errno_string();
 #endif /* __TYPE */
 #ifdef __TIME_LOADED
 #undef  __TIME
-#define __TIME 1  /* to avoid double definitions in in.h */
+#define __TIME 1		/* to avoid double definitions in in.h */
 #endif /* __TIME_LOADED */
 #include "multinet_root:[multinet.include.sys]time.h"
 #define MULTINET_NO_PROTOTYPES	/* DECC is compatible-but-different */
@@ -404,9 +404,9 @@ extern char *vms_errno_string();
 #include "multinet_root:[multinet.include.sys]ioctl.h"
 #define TCP_INCLUDES_DONE
 /*
-**  Uncomment this if you get compiler messages
-**  about struct timeval having no linkage. - FM
-*/
+ *  Uncomment this if you get compiler messages
+ *  about struct timeval having no linkage. - FM
+ */
 /*#define NO_TIMEVAL*/
 #ifdef NO_TIMEVAL
 struct timeval {
@@ -416,12 +416,11 @@ struct timeval {
 #endif /* NO_TIMEVAL */
 #endif /* MULTINET */
 
-
 #ifdef DECNET
 #include <types.h>
 #include <errno.h>
 #include <time.h>
-#include <types.h>  /* for socket.h */
+#include <types.h>		/* for socket.h */
 #include <socket.h>
 #include <dn>
 #include <dnetdb>
@@ -429,7 +428,6 @@ struct timeval {
 #define TCP_INCLUDES_DONE
 #endif /* DECNET */
 
-
 #ifdef UCX
 #include <types.h>
 #include <errno.h>
@@ -447,7 +445,6 @@ struct timeval {
 #define TCP_INCLUDES_DONE
 #endif /* UCX */
 
-
 #ifdef CMU_TCP
 #include <types.h>
 #include <errno.h>
@@ -460,7 +457,6 @@ struct timeval {
 #define TCP_INCLUDES_DONE
 #endif /* CMU_TCP */
 
-
 #ifdef SOCKETSHR_TCP
 #include <types.h>
 #include <errno.h>
@@ -494,16 +490,16 @@ struct timeval {
 #include <time.h>
 #ifdef VMS_SOCKET_HEADERS
 /*
-**  Not all versions of VMS have the full set of headers
-**  for socket library functions, because the TCP/IP
-**  packages were layered products.  If we want these
-**  specifically, instead of those for the above packages,
-**  the module should be compiled with VMS_SOCKET_HEADERS
-**  defined instead of layered product definitions, above.
-**  If the module is not using socket library functions,
-**  none of the definitions need be used, and we include
-**  only the above three headers. - FM
-*/
+ *  Not all versions of VMS have the full set of headers
+ *  for socket library functions, because the TCP/IP
+ *  packages were layered products.  If we want these
+ *  specifically, instead of those for the above packages,
+ *  the module should be compiled with VMS_SOCKET_HEADERS
+ *  defined instead of layered product definitions, above.
+ *  If the module is not using socket library functions,
+ *  none of the definitions need be used, and we include
+ *  only the above three headers. - FM
+ */
 #include <socket.h>
 #include <in.h>
 #include <inet.h>
@@ -524,11 +520,11 @@ struct timeval {
 #define GLOBALDEF globaldef
 #define GLOBALREF globalref
 #else
-#ifdef __GNUC__		/* this added by Sterling Bjorndahl */
+#ifdef __GNUC__			/* this added by Sterling Bjorndahl */
 #define GLOBALREF_IS_MACRO 1
 #define GLOBALDEF_IS_MACRO 1
-#include <gnu_hacks.h>	/* defines GLOBALREF and GLOBALDEF for GNUC on VMS */
-#endif  /* __GNUC__ */
+#include <gnu_hacks.h>		/* defines GLOBALREF and GLOBALDEF for GNUC on VMS */
+#endif /* __GNUC__ */
 #endif /* VAXC && !DECC */
 
 #include <perror.h>
@@ -611,8 +607,8 @@ Regular BSD unix versions
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif /* HAVE_STRING_H */
-#include <errno.h>          /* independent */
-#ifdef __MVS__  /* S/390 -- gil -- 1361 */
+#include <errno.h>		/* independent */
+#ifdef __MVS__			/* S/390 -- gil -- 1361 */
 #include <time.h>
 #endif /* __MVS__ */
 #ifdef SCO
@@ -622,12 +618,12 @@ Regular BSD unix versions
 #if defined(AIX) || defined(SVR4)
 #include <time.h>
 #endif /* AIX || SVR4 */
-#include <sys/time.h>       /* independent */
+#include <sys/time.h>		/* independent */
 #include <sys/stat.h>
-#ifndef __MVS__  /* S/390 -- gil -- 1373 */
+#ifndef __MVS__			/* S/390 -- gil -- 1373 */
 #include <sys/param.h>
 #endif /* __MVS__ */
-#include <sys/file.h>       /* For open() etc */
+#include <sys/file.h>		/* For open() etc */
 
 #if defined(NeXT) || defined(sony_news)
 #ifndef mode_t
@@ -637,7 +633,7 @@ typedef unsigned short mode_t;
 #endif /* NeXT || sony_news */
 
 #define INCLUDES_DONE
-#endif  /* Normal includes */
+#endif /* Normal includes */
 
 /* FIXME: this should be autoconf'd */
 /* Interactive UNIX for i386 and i486 -- Thanks to jeffrey@itm.itm.org */
@@ -655,7 +651,7 @@ typedef unsigned short mode_t;
 #include <sys/pty.h>
 #endif /* !MERGE */
 #ifndef USE_DIRENT
-#define USE_DIRENT     /* sys V style directory open */
+#define USE_DIRENT		/* sys V style directory open */
 #endif /* USE_DIRENT */
 #include <sys/dirent.h>
 #endif /* ISC */
@@ -666,10 +662,10 @@ typedef unsigned short mode_t;
 
 # ifdef HAVE_LIMITS_H
 #  include <limits.h>
-# endif /* HAVE_LIMITS_H */
+# endif				/* HAVE_LIMITS_H */
 # if !defined(MAXINT) && defined(INT_MAX)
 #  define MAXINT INT_MAX
-# endif /* !MAXINT && INT_MAX */
+# endif				/* !MAXINT && INT_MAX */
 
 #else
 
@@ -700,15 +696,15 @@ Defaults
  */
 #ifndef TCP_INCLUDES_DONE
 #ifndef NO_IOCTL
-#include <sys/ioctl.h> /* EJB */
+#include <sys/ioctl.h>		/* EJB */
 #endif /* !NO_IOCTL */
 #include <sys/socket.h>
 #include <netinet/in.h>
 #ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>      /* Must be after netinet/in.h */
+#include <arpa/inet.h>		/* Must be after netinet/in.h */
 #endif
 #include <netdb.h>
-#endif  /* TCP includes */
+#endif /* TCP includes */
 
 typedef unsigned short PortNumber;
 
@@ -788,7 +784,7 @@ ROUGH ESTIMATE OF MAX PATH LENGTH
 #ifdef PATH_MAX
 #define HT_MAX_PATH PATH_MAX
 #else
-#define HT_MAX_PATH 1024                        /* Any better ideas? */
+#define HT_MAX_PATH 1024	/* Any better ideas? */
 #endif
 #endif
 #endif /* HT_MAX_PATH */
@@ -804,12 +800,13 @@ ROUGH ESTIMATE OF MAX PATH LENGTH
 #ifdef SELECT
 #ifndef FD_SET
 typedef unsigned int fd_set;
+
 #define FD_SET(fd,pmask) (*(pmask)) |=  (1<<(fd))
 #define FD_CLR(fd,pmask) (*(pmask)) &= ~(1<<(fd))
 #define FD_ZERO(pmask)   (*(pmask))=0
 #define FD_ISSET(fd,pmask) (*(pmask) & (1<<(fd)))
-#endif  /* !FD_SET */
-#endif  /* SELECT */
+#endif /* !FD_SET */
+#endif /* SELECT */
 
 /*
  * Macro for setting errno - only define this if you really can do it.
@@ -817,7 +814,7 @@ typedef unsigned int fd_set;
 #if defined(CAN_SET_ERRNO) || (!defined(errno) && (!defined(VMS) || defined(UCX)))
 #define set_errno(value) errno = value
 #else
-#define set_errno(value) /* we do not know how */
+#define set_errno(value)	/* we do not know how */
 #endif
 
 /* IPv6 support */
@@ -827,9 +824,10 @@ typedef unsigned int fd_set;
 
 #if !defined(__MINGW32__)
 #ifdef INET6
-typedef struct sockaddr_storage SockA;  /* See netinet/in.h */
+typedef struct sockaddr_storage SockA;	/* See netinet/in.h */
+
 #else
-typedef struct sockaddr_in SockA;  /* See netinet/in.h */
+typedef struct sockaddr_in SockA;	/* See netinet/in.h */
 #endif /* INET6 */
 #endif
 
@@ -848,7 +846,7 @@ typedef struct sockaddr_in SockA;  /* See netinet/in.h */
 #endif /* INET6 */
 
 #ifndef MAXHOSTNAMELEN
-#define MAXHOSTNAMELEN 64		/* Arbitrary limit */
+#define MAXHOSTNAMELEN 64	/* Arbitrary limit */
 #endif /* MAXHOSTNAMELEN */
 
 #endif /* TCP_H */