version 2.40, 1995/04/27 23:11:47
|
version 2.41, 1995/05/04 22:09:16
|
Line 18 includes for each system the files neces
|
Line 18 includes for each system the files neces
|
I/O. <P> |
I/O. <P> |
|
|
This module is a part of the <A |
This module is a part of the <A |
HREF="http://info.cern.ch/hypertext/WWW/Library/User/Guide/Guide.html"> |
HREF="http://www.w3.org/hypertext/WWW/Library/User/Guide/Guide.html"> |
Library of Common Code</A>. |
Library of Common Code</A>. |
|
|
<H3>Authors</H3> |
<H3>Authors</H3> |
Line 37 Library of Common Code</A>.
|
Line 37 Library of Common Code</A>.
|
<DD> Susan C. Weber <sweber@kyle.eitech.com> |
<DD> Susan C. Weber <sweber@kyle.eitech.com> |
<DT>HF |
<DT>HF |
<DD> Henrik Frystyk, <frystyk@dxcern.cern.ch> |
<DD> Henrik Frystyk, <frystyk@dxcern.cern.ch> |
|
<DT>CLB |
|
<DD>Charlie Brooks (cbrooks@osf.org) |
</DL> |
</DL> |
|
|
<H3>History:</H3> |
<H3>History:</H3> |
Line 47 the WWW library.
|
Line 49 the WWW library.
|
<DT>16 Jan 92 |
<DT>16 Jan 92 |
<DD> PC code from (EvA) |
<DD> PC code from (EvA) |
<DT>22 Apr 93 |
<DT>22 Apr 93 |
<DD> Merged diffs bits from |
<DD>Merged diffs bits from |
xmosaic release |
xmosaic release |
<DT>29 Apr 93 |
<DT>29 Apr 93 |
<DD> Windows/NT code from (SCW) |
<DD>Windows/NT code from (SCW) |
<DT>29 Sep 93 |
<DT>29 Sep 93 |
<DD> VMS fixes (MD) |
<DD>VMS fixes (MD) |
|
<DT>Mar 95 |
|
<DD>CLB - changed SLEEP() macro for Windows/NT MSC compiler added |
|
BOOLEAN_DEFINED macro to avoid duplicate definitions in HUtils.h |
|
changed netread() macros t support reading from stdin,etc. as well as |
|
sockets. (Required for linemode browser to work). |
</DL> |
</DL> |
|
|
<PRE> |
<PRE> |
Line 69 system-specific sections later on. There
|
Line 76 system-specific sections later on. There
|
#define SELECT /* Can handle >1 channel */ |
#define SELECT /* Can handle >1 channel */ |
#define GOT_SYSTEM /* Can call shell with string */ |
#define GOT_SYSTEM /* Can call shell with string */ |
#define GOT_PASSWD /* Can we use getpass() command */ |
#define GOT_PASSWD /* Can we use getpass() command */ |
|
#define HAVE_STRERROR /* Do we have the ANSI way of doing this */ |
</PRE> |
</PRE> |
|
|
<HR> |
<HR> |
Line 277 Hounslow <P.M.Hounslow@reading.ac.uk>, a
|
Line 285 Hounslow <P.M.Hounslow@reading.ac.uk>, a
|
#define NETCLOSE(s) closesocket(s) |
#define NETCLOSE(s) closesocket(s) |
#define IOCTL(s,c,a) ioctlsocket(s,c, (long *) a) |
#define IOCTL(s,c,a) ioctlsocket(s,c, (long *) a) |
|
|
|
#define MKDIR(a,b) mkdir((a)) |
|
#define REMOVE_FILE remove |
|
|
#include <io.h> |
#include <io.h> |
#include <string.h> |
#include <string.h> |
#include <process.h> |
#include <process.h> |
Line 295 Hounslow <P.M.Hounslow@reading.ac.uk>, a
|
Line 306 Hounslow <P.M.Hounslow@reading.ac.uk>, a
|
#define HAS_GETCWD |
#define HAS_GETCWD |
#define NO_GETPASSWD |
#define NO_GETPASSWD |
#define NO_GETDOMAINNAME |
#define NO_GETDOMAINNAME |
|
#define BOOLEAN_DEFINED |
|
|
#define INCLUDES_DONE |
#define INCLUDES_DONE |
#define TCP_INCLUDES_DONE |
#define TCP_INCLUDES_DONE |
Line 428 Some special things for the 32 bit versi
|
Line 440 Some special things for the 32 bit versi
|
#define EHOSTDOWN WSAEHOSTDOWN |
#define EHOSTDOWN WSAEHOSTDOWN |
#define EISCONN WSAEISCONN |
#define EISCONN WSAEISCONN |
|
|
#define SLEEP(n) Sleep((n)000) |
#undef NETREAD |
|
#undef NETWRITE |
|
|
|
#define NETREAD(s,b,l) ((s) >= 10) ? recv((s),(b),(l),0) : read((s), (b), (l)) |
|
#define NETWRITE(s,b,l) ((s) >= 10) ? send((s),(b),(l),0) : write((s),(b), (l)) |
|
|
|
#undef NO_UNIX_IO |
|
#define NO_GROUPS |
|
|
|
/* Converts from Unix sleep to NT Sleep() */ |
|
#define SLEEP(n) Sleep((n) * 1000) |
#endif |
#endif |
</PRE> |
</PRE> |
|
|
Line 603 typedef unsigned long mode_t;
|
Line 625 typedef unsigned long mode_t;
|
#endif /* non VMS */ |
#endif /* non VMS */ |
</PRE> |
</PRE> |
|
|
|
<H3>Strftime and other time stuff</H3> |
|
|
|
<PRE> |
|
#ifdef VMS |
|
#ifndef DECC |
|
#define NO_STRFTIME |
|
#endif |
|
#define NO_MKTIME |
|
#define NO_TIMEGM |
|
#define NO_GMTOFF |
|
#define NO_TIMEZONE |
|
#endif |
|
</PRE> |
|
|
<H3>Definition of Errno</H3> |
<H3>Definition of Errno</H3> |
|
|
<PRE> |
<PRE> |
Line 657 typedef mode_t int;
|
Line 693 typedef mode_t int;
|
#define S_ISREG(m) (((m)& S_IFMT) == S_IFREG) |
#define S_ISREG(m) (((m)& S_IFMT) == S_IFREG) |
#define WEXITSTATUS(s) (((s).w_status >> 8) & 0377) |
#define WEXITSTATUS(s) (((s).w_status >> 8) & 0377) |
#define NO_STRFTIME |
#define NO_STRFTIME |
|
|
|
/* Mips can't uppercase non-alpha */ |
|
#define TOLOWER(c) (isupper(c) ? tolower(c) : (c)) |
|
#define TOUPPER(c) (islower(c) ? toupper(c) : (c)) |
</PRE> |
</PRE> |
|
|
<H3>File Permissions</H3> |
<H3>File Permissions</H3> |
Line 686 Includes Linux (thanks to Rainer Klute)
|
Line 726 Includes Linux (thanks to Rainer Klute)
|
<PRE> |
<PRE> |
#if defined(__svr4__) || defined(_POSIX_SOURCE) || defined(__hpux) |
#if defined(__svr4__) || defined(_POSIX_SOURCE) || defined(__hpux) |
|
|
|
#define NO_GMTOFF |
|
|
#ifdef UTS4 /* UTS wants sys/types.h first */ |
#ifdef UTS4 /* UTS wants sys/types.h first */ |
#include <sys/types.h> |
#include <sys/types.h> |
#endif |
#endif |
Line 711 This is for NCR 3000 and Pyramid that al
|
Line 753 This is for NCR 3000 and Pyramid that al
|
#ifndef NGROUPS_MAX |
#ifndef NGROUPS_MAX |
#include <limits.h> |
#include <limits.h> |
#endif |
#endif |
|
|
|
/* Pyramid and Mips can't uppercase non-alpha */ |
|
#ifdef pyramid |
|
#define TOLOWER(c) (isupper(c) ? tolower(c) : (c)) |
|
#define TOUPPER(c) (islower(c) ? toupper(c) : (c)) |
|
#endif |
|
|
</PRE> |
</PRE> |
|
|
<CODE>getwd()</CODE> is BSD. System V has <CODE>getcwd()</CODE> |
<CODE>getwd()</CODE> is BSD. System V has <CODE>getcwd()</CODE> |
Line 728 This is for NCR 3000 and Pyramid that al
|
Line 777 This is for NCR 3000 and Pyramid that al
|
#include <time.h> |
#include <time.h> |
#include <fcntl.h> |
#include <fcntl.h> |
|
|
|
#ifndef R_OK |
|
#define R_OK 4 |
|
#endif |
#define NO_STRFTIME |
#define NO_STRFTIME |
#define WEXITSTATUS(x) ((int)((x).w_T.w_Retcode)) |
#define WEXITSTATUS(x) ((int)((x).w_T.w_Retcode)) |
|
|
Line 756 by Lauren Weinstein <lauren@vortex.co
|
Line 808 by Lauren Weinstein <lauren@vortex.co
|
#define d_namlen d_reclen |
#define d_namlen d_reclen |
#include <sys/limits.h> |
#include <sys/limits.h> |
typedef int mode_t; |
typedef int mode_t; |
|
|
#define SIGSTP |
#define SIGSTP |
|
#define NO_GMTOFF |
|
|
#define POSIXWAIT |
#define POSIXWAIT |
#define _POSIX_SOURCE |
#define _POSIX_SOURCE |
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/wait.h> |
#include <sys/wait.h> |
#include <net/errno.h> |
#include <net/errno.h> |
Line 777 typedef int mode_t;
|
Line 833 typedef int mode_t;
|
</PRE> |
</PRE> |
|
|
<H2>NeXT</H2> |
<H2>NeXT</H2> |
|
|
|
Next has a lot of strange changes in constants... |
|
|
<PRE> |
<PRE> |
#ifdef NeXT |
#ifdef NeXT |
#include <sys/types.h> |
#include <sys/types.h> |
Line 831 jim@jagubox.gsfc.nasa.gov</ADDRESS>
|
Line 890 jim@jagubox.gsfc.nasa.gov</ADDRESS>
|
#ifdef _AUX |
#ifdef _AUX |
#include <time.h> |
#include <time.h> |
#define WEXITSTATUS(s) (((s).w_status >> 8) & 0377) |
#define WEXITSTATUS(s) (((s).w_status >> 8) & 0377) |
|
#define NO_STRFTIME |
#endif |
#endif |
</PRE> |
</PRE> |
|
|
Line 884 These are a default unix where not alrea
|
Line 944 These are a default unix where not alrea
|
#define FNDELAY O_NDELAY |
#define FNDELAY O_NDELAY |
#endif |
#endif |
|
|
#if !defined(NeXT) && !defined(BSD4_4) && !defined(NetBSD) |
#if defined(sun) && !defined(__svr4__) |
extern char *sys_errlist[]; |
#define NO_MKTIME |
extern int sys_nerr; |
|
#endif |
#endif |
|
|
#endif /* unix */ |
#endif /* unix */ |
Line 961 typedef struct sockaddr_in SockA; /* Se
|
Line 1020 typedef struct sockaddr_in SockA; /* Se
|
|
|
<H3>Definition of errno and Return Code</H3> |
<H3>Definition of errno and Return Code</H3> |
|
|
|
This is the definition of error codes and the corresponding string |
|
constants. If we do not have the <CODE>strerror</CODE> function then |
|
try the error list table. |
|
|
<PRE> |
<PRE> |
#ifndef ERRNO_DONE |
#ifndef ERRNO_DONE |
extern int errno; |
extern int errno; |
#define socerrno errno |
#define socerrno errno |
#endif |
#endif |
|
|
|
#ifndef HAVE_STRERROR /* Otherwise use the table */ |
|
extern char *sys_errlist[]; |
|
extern int sys_nerr; |
|
#endif |
</PRE> |
</PRE> |
|
|
<H3>Definition of Socket Desrciptores</H3> |
<H3>Definition of Socket Desrciptores</H3> |
Line 1041 value. However, the value <B>IS</B> used
|
Line 1109 value. However, the value <B>IS</B> used
|
#endif |
#endif |
</PRE> |
</PRE> |
|
|
|
<H3>File/Directory Management</H3> |
|
<PRE> |
|
#ifndef MKDIR |
|
#define MKDIR(a,b) mkdir((a), (b)) |
|
#endif |
|
|
|
#ifndef REMOVE_FILE |
|
#define REMOVE_FILE unlink |
|
#endif |
|
</PRE> |
|
|
<H3>Macros for manipulating masks for select()</H3> |
<H3>Macros for manipulating masks for select()</H3> |
<PRE> |
<PRE> |
#ifdef SELECT |
#ifdef SELECT |
Line 1063 typedef unsigned int fd_set;
|
Line 1142 typedef unsigned int fd_set;
|
#endif |
#endif |
</PRE> |
</PRE> |
|
|
<H3>White Characters</H3> |
|
|
|
Is character c white space? For speed, include all control characters |
|
|
|
<PRE> |
|
#define WHITE(c) (((unsigned char)(TOASCII(c))) <= 32) |
|
</PRE> |
|
|
|
<H3>Cache file prefix</H3> |
<H3>Cache file prefix</H3> |
|
|
This is something onto which we tag something meaningful to make a cache |
This is something onto which we tag something meaningful to make a cache |