System Dependencies

/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/

This file makes up for the differencies in the systems and platforms supported by libwww. On Unix, it is a question of using autoconf to figure out what environment we are in. This is done by running the configure script which creates a wwwconf.h file. This configuration include file contains a large set of macro definitions telling what features we have and don't have. On platforms not supported by autoconf (Windows, Mac, VMS etc.) you will find the information normally contained in the wwwconf.h file directly included below. The second part of this file uses all the information that we either have from the wwwconf.h file or directly coded and actually does the includes etc.

This module is a part of the W3C Sample Code Library.

Authors

TBL
Tim Berners-Lee, W3 project, CERN, <timbl@w3.org>
EvA
Eelco van Asperen <evas@cs.few.eur.nl>
MA
Marc Andreesen NCSA
MD
Mark Donszelmann <duns@vxcern.cern.ch>
AT
Aleksandar Totic <atotic@ncsa.uiuc.edu>
SCW
Susan C. Weber <sweber@kyle.eitech.com>
HF
Henrik Frystyk, <frystyk@w3.org>
CLB
Charlie Brooks, <cbrooks@osf.org>

History:

22 Feb 91
Written (TBL) as part of the WWW library.
16 Jan 92
PC code from (EvA)
22 Apr 93
Merged diffs bits from xmosaic release
29 Apr 93
Windows/NT code from (SCW)
29 Sep 93
Mar 96 CLB - changed SLEEP() macro for Windows/NT MSC compiler added BOOLEAN_DEFINED macro to avoid duplicate definitions in HUtils.h changed netread() macros to support reading from stdin,etc. as well as sockets. (Required for linemode browser to work).
Henrik
Changed to support autoconf for Unix
#ifndef SYSDEP_H
#define SYSDEP_H

Platform Specific Stuff

Unix

We rely on autoconf to do the dirty job. If you have any changhes then please add them to the configure script

#ifdef HAVE_CONFIG_H
#include <wwwconf.h>
#endif

Microsoft Windows Win32 API

Help provided by Eric Prud'hommeaux, Susan C. Weber <sweber@kyle.eitech.com>, Paul Hounslow <P.M.Hounslow@reading.ac.uk>, and a lot of other PC people.

#if defined(_WINDOWS) || defined(_CONSOLE)
#define WWW_MSWINDOWS
#endif

#if defined(_WINDOWS) && !defined (_CONSOLE)
#define WWW_WIN_WINDOW
#endif

#if defined(_CONSOLE)
#define WWW_WIN_CONSOLE
#endif

#ifdef WWW_MSWINDOWS

#include <windows.h>
#include <io.h>
#include <process.h>
#include <winsock.h>

#include "windows/config.h"

#define NETREAD(s,b,l)  recv((s),(b),(l),0)
#define NETWRITE(s,b,l) send((s),(b),(l),0)
#define NETCLOSE(s)     closesocket(s)
#define IOCTL(s,c,a)	ioctlsocket(s,c, (long *) a)

#define MKDIR(a,b)	mkdir((a))
#define REMOVE(a)	remove((a))
#define DEFAULT_SUFFIXES	"."

#ifndef _CONSOLE
#define NO_STDIO
#endif

#define SOCKET SOCKET			/* WinSocks socket descriptor */
#define INVSOC INVALID_SOCKET		/* WinSocks invalid socket */

#define DESIRED_WINSOCK_VERSION	0x0101  /* we'd like winsock ver 1.1... */
#define MINIMUM_WINSOCK_VERSION	0x0101  /* ...but we'll take ver 1.1 :) */

File and Directory Access

These next defintions are because the UNIX stuff is not supplied with BC4 (Paul Hounslow <P.M.Hounslow@reading.ac.uk>)

#define NO_UNIX_IO

#define	_IFMT		0170000	/* type of file */
#define	_IFDIR		0040000	/* directory */
#define	_IFCHR		0020000	/* character special */
#define	_IFBLK		0060000	/* block special */
#define	_IFREG		0100000	/* regular */
#define	_IFLNK		0120000	/* symbolic link */
#define	_IFSOCK		0140000	/* socket */
#define	_IFIFO		0010000	/* fifo */

#define	S_ISUID		0004000	/* set user id on execution */
#define	S_ISGID		0002000	/* set group id on execution */
#define	S_ISVTX		0001000	/* save swapped text even after use */

#ifdef S_IREAD
#undef S_IREAD
#define	S_IREAD		0000400	/* read permission, owner */
#endif

#ifdef S_IWRITE
#undef S_IWRITE
#define	S_IWRITE 	0000200	/* write permission, owner */
#endif

#ifdef S_IEXEC
#undef S_IEXEC
#define	S_IEXEC		0000100	/* execute/search permission, owner */
#endif

#define	S_ENFMT 	0002000	/* enforcement-mode locking */

#ifdef S_IFMT
#undef S_IFMT
#define	S_IFMT		_IFMT
#endif

#ifdef S_IDIR
#undef S_IDIR
#define	S_IFDIR		_IFDIR
#endif

#ifdef S_IFCHR
#undef S_IFCHR
#define	S_IFCHR		_IFCHR
#endif

#ifdef S_IBLK
#undef S_IBLK
#define	S_IFBLK		_IFBLK
#endif

#ifdef S_IREG
#undef S_IREG
#define	S_IFREG		_IFREG
#endif

#define	S_IFLNK		_IFLNK

#ifdef S_IFIFO
#undef S_IFIFO
#define	S_IFIFO		_IFIFO
#endif

#define	S_IRWXU 	0000700	/* rwx, owner */
#define		S_IRUSR	0000400	/* read permission, owner */
#define		S_IWUSR	0000200	/* write permission, owner */
#define		S_IXUSR	0000100	/* execute/search permission, owner */
#define	S_IRWXG		0000070	/* rwx, group */
#define		S_IRGRP	0000040	/* read permission, group */
#define		S_IWGRP	0000020	/* write permission, grougroup */
#define		S_IXGRP	0000010	/* execute/search permission, group */
#define	S_IRWXO		0000007	/* rwx, other */
#define		S_IROTH	0000004	/* read permission, other */
#define		S_IWOTH	0000002	/* write permission, other */
#define		S_IXOTH	0000001	/* execute/search permission, other */

#define	S_ISREG(m)	(((m)&_IFMT) == _IFREG)

#define DIR_SEPARATOR
#define DIR_SEPARATOR_CHAR	'\\'
#define DIR_SEPARATOR_STR	"\\"

Errno and Return Codes

Winsock has its own errno codes and it returns them through WSAGetLastError(). However, it does also support BSD error codes, so we make a compromise. WSA definitions moved from _WIN32 ifdef by EGP

#define socerrno WSAGetLastError()
#define ERRNO_DONE

Return code for socket functions. We can't use -1 as return value

#define EWOULDBLOCK     WSAEWOULDBLOCK
#define EINPROGRESS     WSAEINPROGRESS
#define ECONNREFUSED    WSAECONNREFUSED
#define ETIMEDOUT       WSAETIMEDOUT
#define ENETUNREACH     WSAENETUNREACH
#define EHOSTUNREACH    WSAEHOSTUNREACH
#define EHOSTDOWN       WSAEHOSTDOWN
#define EISCONN         WSAEISCONN
#define EINVAL          WSAEINVAL
#define ECONNRESET      WSAECONNRESET
#define ECONNABORTED    WSAECONNABORTED
#define ESHUTDOWN       WSAESHUTDOWN

/* Some compilers do only define WIN32 and NOT _WINDOWS */
#define NO_GROUPS

#ifdef _WIN32
#define MKDIR(a,b)	mkdir((a))     /* CLB NT has mkdir, but only one arg */
#define SLEEP(n)        Sleep((n)*1000)
#else
#define MKDIR(a,b)	_mkdir((a))    /* CLB NT has mkdir, but only one arg */
#endif /* WIN32 */

#endif /* WWW_MSWINDOWS */

Macintosh

mingw32 - Minimalist GNU for Windows

A bit like Cygwin, except it uses the native Windows API, which means the programs do not need the huge Cygwin DLL to run.

Patch by Richard Atterer <richard@atterer.net>, October 2001

#ifdef __MINGW32__

#include <winsock2.h>

#define WWW_MSWINDOWS
/* #define WWW_WIN_CONSOLE */
#define WWW_WIN_WINDOW
/* #define WWW_WIN_ASYNC */
/* #define WWW_WIN_DLL */

#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_
#endif

#define NETREAD(s,b,l)  recv((s),(b),(l),0)
#define NETWRITE(s,b,l) send((s),(b),(l),0)
#define NETCLOSE(s)     closesocket(s)
#define IOCTL(s,c,a)	ioctlsocket(s,c, (long *) a)

#define MKDIR(a,b)      mkdir(a)
#define REMOVE(a)	remove((a))
#define DEFAULT_SUFFIXES	"."

#define SOCKET SOCKET			/* WinSocks socket descriptor */
#define INVSOC INVALID_SOCKET		/* WinSocks invalid socket */

#define DESIRED_WINSOCK_VERSION 0x0101  /* we'd like winsock ver 1.1... */
#define MINIMUM_WINSOCK_VERSION 0x0101  /* ...but we'll take ver 1.1 :) */

#define DIR_SEPARATOR
#define DIR_SEPARATOR_CHAR     '\\'
#define DIR_SEPARATOR_STR      "\\"

#define socerrno WSAGetLastError()
#define ERRNO_DONE

/* Taken from the WIN32 stuff above. */
#define EWOULDBLOCK     WSAEWOULDBLOCK
#define EINPROGRESS     WSAEINPROGRESS
#define ECONNREFUSED    WSAECONNREFUSED
#define ETIMEDOUT       WSAETIMEDOUT
#define ENETUNREACH     WSAENETUNREACH
#define EHOSTUNREACH    WSAEHOSTUNREACH
#define EHOSTDOWN       WSAEHOSTDOWN
#define EISCONN         WSAEISCONN
/*#define EINVAL          WSAEINVAL*/
#define ECONNRESET      WSAECONNRESET
#define ECONNABORTED    WSAECONNABORTED
#define ESHUTDOWN       WSAESHUTDOWN

/* The configure.in script is wrong to default to #define GETGROUPS_T int */
#ifdef GETGROUPS_T
#undef GETGROUPS_T
#endif

#define HT_LSTAT stat

#endif /* __MINGW32__ */

Macintosh

We have two environments on Macintosh: Codeworrior and MPV.

Metrowerks Codewarrior 6

Metrowerks Codewarrior is one development environment on the Mac. We are using GUSI (1.5.9) by Matthias Neeracher <neeri@iis.ee.ethz.ch> for our socket lib. You can find more information about the GUSI Library from Switzerland.

Compiles on PPC. Should compile on 68K.

August 31, 1995 by Steven T. Roussey <sroussey@eng.uci.edu> (STR). and jeff@macalot.com (Jeff Dripps). Thanks a bunch!

#ifdef __MWERKS__
#include <gusi.h>
#include <dirent.h>
#include <errno.h>
#include <sys/errno.h>
#include <sioux.h>

#define INCLUDES_DONE
#define TCP_INCLUDES_DONE

#define GUSI                    /* Identifies changes made for GUSI */

#undef  HAVE_GETDOMAINNAME      /* STR */
#undef  HAVE_GETPASS
#undef  HAVE_GETWD

#define HAVE_GETCWD
#define USE_DIRENT
#define NO_GROUPS
#define GOT_READ_DIR

#undef  HAVE_TIMEZONE           /* STR */
#define NO_GMTOFF
#define HAVE_STRERROR
#define HAVE_GETHOSTNAME

#define d_ino           d_fileno        /* backward compatibility */

#define SLEEP(n)        GUSIDefaultSpin( SP_SLEEP, n/60)

#define MKDIR(a,b)      mkdir(a)

#define HAVE_STRFTIME           // added JTD:5/1/96
#define HAVE_MKTIME             // added JTD:5/1/96
#define HAVE_STRCHR             // added JTD:5/1/96
#define STDC_HEADERS            // added JTD:5/1/96
#define HAVE_MEMCPY             // added JTD:5/1/96
#define TTY_IS_SELECTABLE       // added JTD:5/1/96
#define HAVE_READDIR            // added JTD:5/1/96
#define HAVE_DIRENT_INO         // added JTD:5/1/96
#define HAVE_DIRENT_H           // added JTD:5/1/96

#endif

MPW

MPW is one development environment on the Mac.

This entry was created by Aleksandar Totic (atotic@ncsa.uiuc.edu) this file is compatible with sockets package released by NCSA. One major conflict is that this library redefines write/read/etc as macros. In some of HTML code these macros get executed when they should not be. Such files should define NO_SOCKET_DEFS on top. This is a temporary hack.

#ifdef applec			/* MPW  */
#undef HAVE_SYSTEM
#define DEBUG			/* Can't put it on the CC command line */

#define NO_UNIX_IO		/* getuid() missing */
#undef  HAVE_GETPID		/* getpid() does not exist */
#define NO_GETWD		/* getwd() does not exist */

#define NETCLOSE s_close    /* Routine to close a TCP-IP socket */
#define NETREAD  s_read	    /* Routine to read from a TCP-IP socket */
#define NETWRITE s_write    /* Routine to write to a TCP-IP socket */

#define _ANSI_SOURCE
#define GUI
#define LINEFEED 10
#define ANON_FTP_HOSTNAME
#ifndef NO_SOCKET_DEFS
#include <MacSockDefs.h>
#endif /* NO_SOCKET_DEFS */

#include <socket.ext.h>
#include <string.h>

#endif /* applec MPW */

VAX/VMS

Under VMS, there are many versions of TCP-IP. Define one if you do not use Digital's UCX product:

UCX
DEC's "Ultrix connection" (default)
WIN_TCP
From Wollongong, now GEC software.
MULTINET
From SRI, now from TGV Inv.
DECNET
Cern's TCP socket emulation over DECnet

The last three do not interfere with the unix i/o library, and so they need special calls to read, write and close sockets. In these cases the socket number is a VMS channel number, so we make the @@@ HORRIBLE @@@ assumption that a channel number will be greater than 10 but a unix file descriptor less than 10. It works.

#ifdef VMS
#include "HTVMSUtils.h"
#define CACHE_FILE_./usr/share/doc/libwww-doc/html/Library/src/HTLog.html0100644000000000000000000000375107503632575021474 0ustar  rootroot

W3C Sample Code Library libwww Log Class



Log Manager

/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
This is a generic log object which can be used to log events to a file.

This module is implemented by HTLog.c, and it is a part of the W3C Sample Code Library.

#ifndef HTLIBLOG_H
#define HTLIBLOG_H

#include "HTReq.h"

Create a new Log Object

Create a new object and open the log file. The time used in the log file is either GMT or local dependent on local.
typedef struct _HTLog HTLog;

extern HTLog * HTLog_open (const char * filename, BOOL local, BOOL append);

Delete a Log Object

Close the log file and delete the object
extern BOOL HTLog_close (HTLog * log);

How many times has log object been accessed?

Returns access count number or -1
extern int HTLog_accessCount (HTLog * log);

Log a Client Request in CLF

This functions logs the result of a request in what's close to CLF. It can be used on client side to track user behavior.
extern BOOL HTLog_addCLF (HTLog * log, HTRequest * request, int status);

Log Referer Fields

This functions logs the referer logs of where the user has been.
extern BOOL HTLog_addReferer (HTLog * log, HTRequest * request, int status);

Log the following line

A generic logger - logs whatever you put in as the line. The caller is responsible for adding a line feed if desired.
extern BOOL HTLog_addLine (HTLog * log, const char * line);

Log the Following Variable Arguments

A generic logger with variable arguments
extern BOOL HTLog_addText (HTLog * log, const char * fmt, ...);
#endif

@(#) $Id: HTLog.html,v 2.17 1998/05/14 02:10:40 frystyk Exp $
./usr/share/doc/libwww-doc/html/Library/src/wwwsys.html0100644000000000000000000010061007503632575022072 0ustar rootroot W3C Sample Code Library libwww System Dependencies

System Dependencies

/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/

This file makes up for the differencies in the systems and platforms supported by libwww. On Unix, it is a question of using autoconf to figure out what environment we are in. This is done by running the configure script which creates a wwwconf.h file. This configuration include file contains a large set of macro definitions telling what features we have and don't have. On platforms not supported by autoconf (Windows, Mac, VMS etc.) you will find the information normally contained in the wwwconf.h file directly included below. The second part of this file uses all the information that we either have from the wwwconf.h file or directly coded and actually does the includes etc.

This module is a part of the W3C Sample Code Library.

Authors

TBL
Tim Berners-Lee, W3 project, CERN, <timbl@w3.org>
EvA
Eelco van Asperen <evas@cs.few.eur.nl>
MA
Marc Andreesen NCSA
MD
Mark Donszelmann <duns@vxcern.cern.ch>
AT
Aleksandar Totic <atotic@ncsa.uiuc.edu>
SCW
Susan C. Weber <sweber@kyle.eitech.com>
HF
Henrik Frystyk, <frystyk@w3.org>
CLB
Charlie Brooks, <cbrooks@osf.org>

History:

22 Feb 91
Written (TBL) as part of the WWW library.
16 Jan 92
PC code from (EvA)
22 Apr 93
Merged diffs bits from xmosaic release
29 Apr 93
Windows/NT code from (SCW)
29 Sep 93
Mar 96 CLB - changed SLEEP() macro for Windows/NT MSC compiler added BOOLEAN_DEFINED macro to avoid duplicate definitions in HUtils.h changed netread() macros to support reading from stdin,etc. as well as sockets. (Required for linemode browser to work).
Henrik
Changed to support autoconf for Unix
#ifndef SYSDEP_H
#define SYSDEP_H

Platform Specific Stuff

Unix

We rely on autoconf to do the dirty job. If you have any changhes then please add them to the configure script

#ifdef HAVE_CONFIG_H
#include <wwwconf.h>
#endif

Microsoft Windows Win32 API

Help provided by Eric Prud'hommeaux, Susan C. Weber <sweber@kyle.eitech.com>, Paul Hounslow <P.M.Hounslow@reading.ac.uk>, and a lot of other PC people.

#if defined(_WINDOWS) || defined(_CONSOLE)
#define WWW_MSWINDOWS
#endif

#if defined(_WINDOWS) && !defined (_CONSOLE)
#define WWW_WIN_WINDOW
#endif

#if defined(_CONSOLE)
#define WWW_WIN_CONSOLE
#endif

#ifdef WWW_MSWINDOWS

#include <windows.h>
#include <io.h>
#include <process.h>
#include <winsock.h>

#include "windows/config.h"

#define NETREAD(s,b,l)  recv((s),(b),(l),0)
#define NETWRITE(s,b,l) send((s),(b),(l),0)
#define NETCLOSE(s)     closesocket(s)
#define IOCTL(s,c,a)	ioctlsocket(s,c, (long *) a)

#define MKDIR(a,b)	mkdir((a))
#define REMOVE(a)	remove((a))
#define DEFAULT_SUFFIXES	"."

#ifndef _CONSOLE
#define NO_STDIO
#endif

#define SOCKET SOCKET			/* WinSocks socket descriptor */
#define INVSOC INVALID_SOCKET		/* WinSocks invalid socket */

#define DESIRED_WINSOCK_VERSION	0x0101  /* we'd like winsock ver 1.1... */
#define MINIMUM_WINSOCK_VERSION	0x0101  /* ...but we'll take ver 1.1 :) */

File and Directory Access

These next defintions are because the UNIX stuff is not supplied with BC4 (Paul Hounslow <P.M.Hounslow@reading.ac.uk>)

#define NO_UNIX_IO

#define	_IFMT		0170000	/* type of file */
#define	_IFDIR		0040000	/* directory */
#define	_IFCHR		0020000	/* character special */
#define	_IFBLK		0060000	/* block special */
#define	_IFREG		0100000	/* regular */
#define	_IFLNK		0120000	/* symbolic link */
#define	_IFSOCK		0140000	/* socket */
#define	_IFIFO		0010000	/* fifo */

#define	S_ISUID		0004000	/* set user id on execution */
#define	S_ISGID		0002000	/* set group id on execution */
#define	S_ISVTX		0001000	/* save swapped text even after use */

#ifdef S_IREAD
#undef S_IREAD
#define	S_IREAD		0000400	/* read permission, owner */
#endif

#ifdef S_IWRITE
#undef S_IWRITE
#define	S_IWRITE 	0000200	/* write permission, owner */
#endif

#ifdef S_IEXEC
#undef S_IEXEC
#define	S_IEXEC		0000100	/* execute/search permission, owner */
#endif

#define	S_ENFMT 	0002000	/* enforcement-mode locking */

#ifdef S_IFMT
#undef S_IFMT
#define	S_IFMT		_IFMT
#endif

#ifdef S_IDIR
#undef S_IDIR
#define	S_IFDIR		_IFDIR
#endif

#ifdef S_IFCHR
#undef S_IFCHR
#define	S_IFCHR		_IFCHR
#endif

#ifdef S_IBLK
#undef S_IBLK
#define	S_IFBLK		_IFBLK
#endif

#ifdef S_IREG
#undef S_IREG
#define	S_IFREG		_IFREG
#endif

#define	S_IFLNK		_IFLNK

#ifdef S_IFIFO
#undef S_IFIFO
#define	S_IFIFO		_IFIFO
#endif

#define	S_IRWXU 	0000700	/* rwx, owner */
#define		S_IRUSR	0000400	/* read permission, owner */
#define		S_IWUSR	0000200	/* write permission, owner */
#define		S_IXUSR	0000100	/* execute/search permission, owner */
#define	S_IRWXG		0000070	/* rwx, group */
#define		S_IRGRP	0000040	/* read permission, group */
#define		S_IWGRP	0000020	/* write permission, grougroup */
#define		S_IXGRP	0000010	/* execute/search permission, group */
#define	S_IRWXO		0000007	/* rwx, other */
#define		S_IROTH	0000004	/* read permission, other */
#define		S_IWOTH	0000002	/* write permission, other */
#define		S_IXOTH	0000001	/* execute/search permission, other */

#define	S_ISREG(m)	(((m)&_IFMT) == _IFREG)

#define DIR_SEPARATOR
#define DIR_SEPARATOR_CHAR	'\\'
#define DIR_SEPARATOR_STR	"\\"

Errno and Return Codes

Winsock has its own errno codes and it returns them through WSAGetLastError(). However, it does also support BSD error codes, so we make a compromise. WSA definitions moved from _WIN32 ifdef by EGP

#define socerrno WSAGetLastError()
#define ERRNO_DONE

Return code for socket functions. We can't use -1 as return value

#define EWOULDBLOCK     WSAEWOULDBLOCK
#define EINPROGRESS     WSAEINPROGRESS
#define ECONNREFUSED    WSAECONNREFUSED
#define ETIMEDOUT       WSAETIMEDOUT
#define ENETUNREACH     WSAENETUNREACH
#define EHOSTUNREACH    WSAEHOSTUNREACH
#define EHOSTDOWN       WSAEHOSTDOWN
#define EISCONN         WSAEISCONN
#define EINVAL          WSAEINVAL
#define ECONNRESET      WSAECONNRESET
#define ECONNABORTED    WSAECONNABORTED
#define ESHUTDOWN       WSAESHUTDOWN

/* Some compilers do only define WIN32 and NOT _WINDOWS */
#define NO_GROUPS

#ifdef _WIN32
#define MKDIR(a,b)	mkdir((a))     /* CLB NT has mkdir, but only one arg */
#define SLEEP(n)        Sleep((n)*1000)
#else
#define MKDIR(a,b)	_mkdir((a))    /* CLB NT has mkdir, but only one arg */
#endif /* WIN32 */

#endif /* WWW_MSWINDOWS */

Macintosh

mingw32 - Minimalist GNU for Windows

A bit like Cygwin, except it uses the native Windows API, which means the programs do not need the huge Cygwin DLL to run.

Patch by Richard Atterer <richard@atterer.net>, October 2001

#ifdef __MINGW32__

#include <winsock2.h>

#define WWW_MSWINDOWS
/* #define WWW_WIN_CONSOLE */
#define WWW_WIN_WINDOW
/* #define WWW_WIN_ASYNC */
/* #define WWW_WIN_DLL */

#ifndef _WINSOCKAPI_
#define _WINSOCKAPI_
#endif

#define NETREAD(s,b,l)  recv((s),(b),(l),0)
#define NETWRITE(s,b,l) send((s),(b),(l),0)
#define NETCLOSE(s)     closesocket(s)
#define IOCTL(s,c,a)	ioctlsocket(s,c, (long *) a)

#define MKDIR(a,b)      mkdir(a)
#define REMOVE(a)	remove((a))
#define DEFAULT_SUFFIXES	"."

#define SOCKET SOCKET			/* WinSocks socket descriptor */
#define INVSOC INVALID_SOCKET		/* WinSocks invalid socket */

#define DESIRED_WINSOCK_VERSION 0x0101  /* we'd like winsock ver 1.1... */
#define MINIMUM_WINSOCK_VERSION 0x0101  /* ...but we'll take ver 1.1 :) */

#define DIR_SEPARATOR
#define DIR_SEPARATOR_CHAR     '\\'
#define DIR_SEPARATOR_STR      "\\"

#define socerrno WSAGetLastError()
#define ERRNO_DONE

/* Taken from the WIN32 stuff above. */
#define EWOULDBLOCK     WSAEWOULDBLOCK
#define EINPROGRESS     WSAEINPROGRESS
#define ECONNREFUSED    WSAECONNREFUSED
#define ETIMEDOUT       WSAETIMEDOUT
#define ENETUNREACH     WSAENETUNREACH
#define EHOSTUNREACH    WSAEHOSTUNREACH
#define EHOSTDOWN       WSAEHOSTDOWN
#define EISCONN         WSAEISCONN
/*#define EINVAL          WSAEINVAL*/
#define ECONNRESET      WSAECONNRESET
#define ECONNABORTED    WSAECONNABORTED
#define ESHUTDOWN       WSAESHUTDOWN

/* The configure.in script is wrong to default to #define GETGROUPS_T int */
#ifdef GETGROUPS_T
#undef GETGROUPS_T
#endif

#define HT_LSTAT stat

#endif /* __MINGW32__ */

Macintosh

We have two environments on Macintosh: Codeworrior and MPV.

Metrowerks Codewarrior 6

Metrowerks Codewarrior is one development environment on the Mac. We are using GUSI (1.5.9) by Matthias Neeracher <neeri@iis.ee.ethz.ch> for our socket lib. You can find more information about the GUSI Library from Switzerland.

Compiles on PPC. Should compile on 68K.

August 31, 1995 by Steven T. Roussey <sroussey@eng.uci.edu> (STR). and jeff@macalot.com (Jeff Dripps). Thanks a bunch!

#ifdef __MWERKS__
#include <gusi.h>
#include <dirent.h>
#include <errno.h>
#include <sys/errno.h>
#include <sioux.h>

#define INCLUDES_DONE
#define TCP_INCLUDES_DONE

#define GUSI                    /* Identifies changes made for GUSI */

#undef  HAVE_GETDOMAINNAME      /* STR */
#undef  HAVE_GETPASS
#undef  HAVE_GETWD

#define HAVE_GETCWD
#define USE_DIRENT
#define NO_GROUPS
#define GOT_READ_DIR

#undef  HAVE_TIMEZONE           /* STR */
#define NO_GMTOFF
#define HAVE_STRERROR
#define HAVE_GETHOSTNAME

#define d_ino           d_fileno        /* backward compatibility */

#define SLEEP(n)        GUSIDefaultSpin( SP_SLEEP, n/60)

#define MKDIR(a,b)      mkdir(a)

#define HAVE_STRFTIME           // added JTD:5/1/96
#define HAVE_MKTIME             // added JTD:5/1/96
#define HAVE_STRCHR             // added JTD:5/1/96
#define STDC_HEADERS            // added JTD:5/1/96
#define HAVE_MEMCPY             // added JTD:5/1/96
#define TTY_IS_SELECTABLE       // added JTD:5/1/96
#define HAVE_READDIR            // added JTD:5/1/96
#define HAVE_DIRENT_INO         // added JTD:5/1/96
#define HAVE_DIRENT_H           // added JTD:5/1/96

#endif

MPW

MPW is one development environment on the Mac.

This entry was created by Aleksandar Totic (atotic@ncsa.uiuc.edu) this file is compatible with sockets package released by NCSA. One major conflict is that this library redefines write/read/etc as macros. In some of HTML code these macros get executed when they should not be. Such files should define NO_SOCKET_DEFS on top. This is a temporary hack.

#ifdef applec			/* MPW  */
#undef HAVE_SYSTEM
#define DEBUG			/* Can't put it on the CC command line */

#define NO_UNIX_IO		/* getuid() missing */
#undef  HAVE_GETPID		/* getpid() does not exist */
#define NO_GETWD		/* getwd() does not exist */

#define NETCLOSE s_close    /* Routine to close a TCP-IP socket */
#define NETREAD  s_read	    /* Routine to read from a TCP-IP socket */
#define NETWRITE s_write    /* Routine to write to a TCP-IP socket */

#define _ANSI_SOURCE
#define GUI
#define LINEFEED 10
#define ANON_FTP_HOSTNAME
#ifndef NO_SOCKET_DEFS
#include <MacSockDefs.h>
#endif /* NO_SOCKET_DEFS */

#include <socket.ext.h>
#include <string.h>

#endif /* applec MPW */

VAX/VMS

Under VMS, there are many versions of TCP-IP. Define one if you do not use Digital's UCX product:

UCX
DEC's "Ultrix connection" (default)
WIN_TCP
From Wollongong, now GEC software.
MULTINET
From SRI, now from TGV Inv.
DECNET
Cern's TCP socket emulation over DECnet

The last three do not interfere with the unix i/o library, and so they need special calls to read, write and close sockets. In these cases the socket number is a VMS channel number, so we make the @@@ HORRIBLE @@@ assumption that a channel number will be greater than 10 but a unix file descriptor less than 10. It works.

#ifdef VMS
#include "HTVMSUtils.h"
#define CACHE_FILE_./usr/share/doc/libwww-doc/html/Library/src/HTLog.html0100644000000000000000000000375107503632575021474 0ustar  rootroot

W3C Sample Code Library libwww Log Class



Log Manager

/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
This is a generic log object which can be used to log events to a file.

This module is implemented by HTLog.c, and it is a part of the W3C Sample Code Library.

#ifndef HTLIBLOG_H
#define HTLIBLOG_H

#include "HTReq.h"

Create a new Log Object

Create a new object and open the log file. The time used in the log file is either GMT or local dependent on local.
typedef struct _HTLog HTLog;

extern HTLog * HTLog_open (const char * filename, BOOL local, BOOL append);

Delete a Log Object

Close the log file and delete the object
extern BOOL HTLog_close (HTLog * log);

How many times has log object been accessed?

Returns access count number or -1
extern int HTLog_accessCount (HTLog * log);

Log a Client Request in CLF

This functions logs the result of a request in what's close to CLF. It can be used on client side to track user behavior.
extern BOOL HTLog_addCLF (HTLog * log, HTRequest * request, int status);

Log Referer Fields

This functions logs the referer logs of where the user has been.
extern BOOL HTLog_addReferer (HTLog * log, HTRequest * request, int status);

Log the following line

A generic logger - logs whatever you put in as the line. The caller is responsible for adding a line feed if desired.
extern BOOL HTLog_addLine (HTLog * log, const char * line);

Log the Following Variable Arguments

A generic logger with variable arguments
extern BOOL HTLog_addText (HTLog * log, const char * fmt, ...);
#endif

@(#) $Id: HTLog.html,v 2.17 1998/05/14 02:10:40 frystyk Exp $
./usr/share/doc/libwww-doc/html/Library/src/wwwsys.html0100644000000000000000000010061007503632575022072 0ustar rootroot W3C Sample Code Library libwww System Dependencies

System Dependencies

/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/

This file makes up for the differencies in the systems and platforms supported