/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */
In addition top the basic W3C Reference Library include file called WWWLib.h you can also include this file called WWWApp.h depending on the needs of your application. However, it is not required and none of the files included below are ever used in the core part of the Library itself. Only if this file is included, the extra modules will get included in the linked object code. It is also possible to include only a subset of the files below if the functionality you are after is covered by them.
#ifndef WWWAPP_H #define WWWAPP_H
#ifdef __cplusplus extern "C" { #endif
The sysdep.h file includes system-specific include files and flags for I/O to network and disk. The only reason for this file is that the Internet world is more complicated than Posix and ANSI.
#include "sysdep.h"
The core part of libwww only provides the hooks for the event manager. There is no event loop internal to the core part. Instead the application must provide the event loop in order to use either pseudo threads or real threads. If the application only uses blocking sockets without threads then it is not required to register any event loop at all. We provide a default implementation of an event loop which you can either take or get some ideas from.
#include "HTEvntrg.h"
This module provides some "make life easier" functions in order to get the application going. They help you generate the first anchor, also called the home anchor. It also contains a nice set of default WWW addresses.
#include "HTHome.h"
You can register a set of callback functions to handle user prompting, error messages, confimations etc. Here we give a set of functions that can be used on almost anu thinkable platform. If you want to provide your own platform dependent implementation then fine :-)
#include "HTDialog.h"
When a request is terminated, the application often has to do some action as a result of the request (and of the result of the request). The Application part of the Library provides two following modules to handle logging and history management. You can register a POST request handler in the Net Manager as described in the User's Guide.
You can find a function called HTLoadTerminate
in the
HTHome module that enables all the functionality
for handling a request result.
Often it is required to log the requests issued to the Library. This can either be the case if the application is a server or it can also be useful in a client application. This module provides a simple logging mechanism which can be enabled if needed.
#include "HTLog.h"
Another type of logging is keeping track of which documents a user has visited when browsing along on the Web. The Library history manager provides a basic set of functionality to keep track of a linear history list.
#include "HTHist.h"
End of application specific modules
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
***************** NEW DOCUMENT *************************** *****************************************************
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */
The cache contains details of temporary disk files which contain the contents of remote documents. There is also a list of cache items for each URL in its anchor object.
There are various ways of handling Expires header when met in a history list. Either it can be ignored all together, the user can be notified with a warning, or the document can be reloaded automatically. This flag decides what action to be taken. The default action is HT_EXPIRES_IGNORE. In HT_EXPIRES_NOTIFY mode you can specify a message to tell the user (NULL is valid in which case my own message pops up - watch out it might be in Danish ;-))
The Library has two notions of a local cache: a file cache and a memory cache. The memory cache is handled by the client and the file cache is handled by the Library. Often the format of a object cached in memory is in the form of a hypertext object ready to be displayed (that is, it's already parsed).
#ifndef WWWCACHE_H #define WWWCACHE_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTCache.h"End of CACHE module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */
This is the basic include file for the core of the W3C Reference Library. The core part of the Library is designed as a set of registration modules with no real functionality in itself. Instead all the functionality comes when the applciation registeres the modules that provides a desired functionaly, for example accessing HTTP servers or the local file system. The Library has a special include file called WWWApp.h which contains all converters, protocol modules, and a lot of other "sugar" modules that can make the core a very powerful Web interface. You can include this one if the application is to use all the functionality of the Library.
#ifndef WWWCORE_H #define WWWCORE_H
#ifdef __cplusplus extern "C" { #endif
The sysdep.h file includes system-specific include files and flags for I/O to network and disk. The only reason for this file is that the Internet world is more complicated than Posix and ANSI.
#include "sysdep.h"
Libwww is based on a request/response paradigm and the Request class defines "an operation to be performed on a URL". The request object is the main entry point for an application to issue a request to the Library - all operations on a URL must use a Request object.
#include "HTReq.h"
Even though you may use the API for the HTRequest object directly in order to issue a request, you will probably find that in real life it is easier to use a higher level abstraction API. This API is provided by the HTAccess module where you will find all kind of functions for down loading a URL etc.
#include "HTAccess.h"
This module defines the set of methods that you can perform on a request, for example GET, HEAD, PUT, POST, DELETE, etc.
#include "HTMethod.h"
An anchor represents a region of a hypertext document which is linked to another anchor in the same or a different document. Another name for anchors would be URLs as an anchor represents all we know about a URL - including where it points to and who points to it.
#include "HTAnchor.h"
This module contains code to parse URIs for the various components according to the URI syntax
#include "HTParse.h"
URLs are written only with the graphic printable characters of the US-ASCII coded character set. All other characters must be escaped before they can be used in URLs. This module defines the methods required for escaping and unescaping the URLs.
#include "HTEscape.h"
This module is like the generic string utility module but it contains more Web related string utility functions. Examples are functions that return a date string, a Message ID string etc.
#include "HTWWWStr.h"
The User profile class manages what we know about a user on this host. This can for example be the FQDN of the host, the user's email address, the time zone, the news server etc.
#include "HTUser.h"
The Event Class defines any event manager to be used by libwww for handling events.
#include "HTEvent.h"
The Error class provides an easy API for registering errors ocurring while the Library serves a request. All errors are registered in an "error stack" in the Request object which allows for nested errors.
#include "HTError.h"
The Alert class defines a set of methods to be used by libwww to be used for passing prompts and message to a user.
#include "HTAlert.h"
The Format Manager is responsible for setting up the stream pipe from the Channel Object to the Request Object when data is arriving, for example as a response to s HTTP Get request. The Format Manager is also responsible for keeping track of the "preferences" of the application and/or user. It is an integral part of the Web and HTTP, that the client application can express its preferences as a set of "accept" headers in a HTTP request.
#include "HTFormat.h"
This module sets up the binding between a file suffix and a media type, language, encoding etc. In a client application the suffixes are used in protocols that does not directly support media types etc., like FTP, and in server applications they are used to make the bindings between the server and the local file store that the server can serve to the rest of the world (well almost)
#include "HTBind.h"
The Stream class defines objects which accepts a sequence of characters. Streams may also have an output in which case multiple stream objects can be cascaded to build a stream pipe where the output of a stream is directed into the input of the next stream object "down the line".
#include "HTStream.h"
The I/O Stream class defines objects which accepts a sequence of characters to and from a transport
#include "HTIOStream.h"
This module contains a set of basic file writer streams that are used to dump data objects to disk at various places within the Library core. Most notably, we use these streams in the Format Manager in order to handle external presenters, for example post script viewers etc. These streams can of course also be used in other contexts by the application.
#include "HTFWrite.h"
The DNS Class defines generic access to the DNS system. It maintains a cache of all visited hosts so that subsequent connects to the same host doesn't imply a new request to the DNS every time.
#include "HTDNS.h"
The Host class manages what we know about a remote host. This can for example be what type of host it is, and what version it is using.
#include "HTHost.h"
The Net class manages information related to a "thread" in libwww. As libwww threads are not really threads but a notion of using interleaved, non-blocking I/O for accessing data objects from the network (or local file system), they can be used on any platform with or without support for native threads.
#include "HTNet.h"
This module has the common code for handling typical Internet functions like getting the name of the local host, getting the domain name and email address of user etc.
#include "HTInet.h"
The Transport Class defines a transport as used by the HTChannel class to communicate with the network, the local file system etc. New transport objects may be registered at any time. This allows the application to easily hook in its own transport layers.
#include "HTTrans.h"
The Protocol class defines an application level protocol (HTTP, FTP, Gopher, etc.) to be used by libwww. Please note that access to the local file system also is considered to be an appliaction level protocol treated identically to for example the HTTP protocol.
#include "HTProt.h"
End of Core modules
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for the directory handling modules that can be used together with the core of the W3C Reference Library. It contains all Directory specific modules which are required to compile and build the DIRECTORY DLL.
#ifndef WWWDIR_H #define WWWDIR_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTIcons.h" #include "HTDescpt.h" #include "HTDir.h"End of DIR module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for the basic FTP module that can be used together with the core of the W3C Reference Library. It contains all FTP specific modules which are required to compile and build the FTP DLL.
#ifndef WWWFTP_H #define WWWFTP_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTFTP.h" /* FTP client state machine */ #include "HTFTPDir.h" /* Streams for parsing FTP output */End of FTP module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for local file handling modules that can be used together with the core of the W3C Reference Library. It contains modules which are required to compile and build the FILE DLL.
#ifndef WWWFILE_H #define WWWFILE_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTMulti.h" #include "HTFile.h"End of FILE module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for local file handling modules that can be used together with the core of the W3C Reference Library. It contains modules which are required to compile and build the FILE DLL.
#ifndef WWWFILE_H #define WWWFILE_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTMulti.h" #include "HTFile.h"End of FILE module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for the basic GOPHER module that can be used together with the core of the W3C Reference Library. It contains all GOPHER specific modules which are required to compile and build the GOPHER DLL.
#ifndef WWWGOPHER_H #define WWWGOPHER_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTGopher.h" /* GOPHER client state machine */End of GOPHER module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for the basic HTML module that can be used together with the core of the W3C Reference Library. It contains all HTML specific modules which are required to compile and build the HTML DLL. Please note that as the HText is not included in this interface. The reason is that the HText interface only is declared by the Library but must be defined by the application. Therefore it can not be part of a DLL but must be included directly in the application.
#ifndef WWWHTML_H #define WWWHTML_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTMLPDTD.h" #include "SGML.h" #include "HTMLGen.h" #include "HTTeXGen.h"End of HTML module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for all HTTP access including the server side and the client side. It can be used together with the core of the W3C Reference Library. It contains all HTTP specific modules which are required to compile and build the HTTP DLL.
#ifndef WWWHTTP_H #define WWWHTTP_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTTPUtil.h" /* Basic things */ #include "HTTP.h" /* HTTP client state machine */ #include "HTTPServ.h" /* HTTP server state machine */ #include "HTTPGen.h" /* General HTTP Header Stream */ #include "HTTPReq.h" /* Stream for generating requests */ #include "HTTPRes.h" /* Stream for gererating responses */ #include "HTTChunk.h" /* Chunk encoding */ #include "HTAAUtil.h" /* Access authentication */ #include "HTAABrow.h" /* Access authentication */End of HTTP module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */
As mentioned in the Library Architecture, libwww consists of a small core and a large set of hooks for adding functionality. By itself, the core it not capable of performing any Web related tasks like accessing a HTTP server or parsing a HTML document. All this functionality must be registered by the application. This way, the core of libwww is kept application independent and can be used as the basic building block for any kind of Web application. The Library comes with a large set of default functions, for example for accessing HTTP and FTP servers, parsing RFC 822 headers etc. This module helps the application programmer setting up all this functionality, but it is important to note that none of it is required in order to use the Library.
#ifndef WWWINIT_H #define WWWINIT_H
#ifdef __cplusplus extern "C" { #endif
This module contains a large set of default initialization functions for protocol modules, stream converters, event managers etc.
#include "HTInit.h"
Register the default set of bindings between file suffixes and media types. This is used for example to guess the media type of a FTP URL of a local file URL.
#include "HTBInit.h"
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the basic include files and the core include files necessary in order to use the W3C Reference Library. It contains all core specific modules which are required to compile and build the Library. No converter streams or protocol modules are included in this file as they are for the application to set up. The Library has a special include file called WWWApp.h which contains all converters and protocol modules known to the Library. You can include this one if the application is to use all the functionality of the Library.
#ifndef WWWLIB_H #define WWWLIB_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "WWWUtil.h" /* Basic utility modules */
#include "WWWCore.h" /* Core modules */
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the module for basic RFC822/MIME parsing that can be used together with the core of the W3C Reference Library. It contains all MIME specific modules which are required to compile and build the MIME DLL.
#ifndef WWWMIME_H #define WWWMIME_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTMIME.h" /* MIME response parser */ #include "HTMIMERq.h" /* MIME request generator */ #include "HTBound.h" /* Multipart MIME parser */ #include "HTMulpar.h" /* Multipart MIME generator stream */ #include "HTHeader.h" /* Extra Header parser and generator */End of MIME module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for the basic NNTP module that can be used together with the core of the W3C Reference Library. It contains all News specific modules which are required to compile and build the News DLL.
#ifndef WWWNEWS_H #define WWWNEWS_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTNews.h" /* NNTP client state machine */ #include "HTNewsLs.h" /* Streams for parsing News output */ #include "HTNDir.h" /* HTML Generator */End of News module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */In addition top the basic W3C Reference Library include file called WWWLib.h you can also include this file depending on the needs of your application. However, it is not required and none of the files included below are ever used in the core part of the Library itself. Only if this file is included, the extra modules will get included in the linked object code. It is also possible to include only a subset of the files below if the functionality you are after is covered by them.
#ifndef WWWRULES_H #define WWWRULES_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTRules.h"
#include "HTProxy.h"End of application specific modules
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */
The stream part of the Library is a set of streams that can be used in many contexts throughout the Library.
#ifndef WWWSTREAM_H #define WWWSTREAM_H
#ifdef __cplusplus extern "C" { #endif
The sysdep.h file includes system-specific include files and flags for I/O to network and disk. The only reason for this file is that the Internet world is more complicated than Posix and ANSI.
#include "sysdep.h"
This stream also buffers the result to find out the content length. If a maximum buffer limit is reached Content-Length is calculated for logs but it is not sent to the client -- rather the buffer is flushed right away.
#include "HTConLen.h" /* Content Length Counter */
This interface provides functionality for guessing unknown media types from
magic words. The stream is a one that reads first a chunk of stuff, tries
to figure out the format, and calls HTStreamStack()
. This is
a kind of lazy-evaluation of HTStreamStack()
. This could be
extended arbitrarily to recognize all the possible file formats in the world,
if someone only had time to do it.
#include "HTGuess.h" /* Guess stream */
The Tee stream just writes everything you put into it into two oter streams. One use (the only use?!) is for taking a cached copey on disk while loading the main copy, without having to wait for the disk copy to be finished and reread it.
#include "HTTee.h" /* T streem for splitting a stream */
This version of the stream object is a hook for clients that want an unparsed stream from libwww. The HTXParse_put_* and HTXParse_write routines copy the content of the incoming buffer into a buffer that is realloced whenever necessary. This buffer is handed over to the client in HTXParse_free. See also HTFWriter for writing to C files.
#include "HTXParse.h" /* External parse stream */
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for the basic Telnet, rlogin, and TN3270 module that can be used together with the core of the W3C Reference Library. It contains all Telnet, rlogin, and TN3270 specific modules which are required to compile and build the Telnet, rlogin, and TN3270 DLL.
#ifndef WWWTELNET_H #define WWWTELNET_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTTelnet.h" /* TELNET client state machine */End of TELNET module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */
#ifndef WWWTRANS_H #define WWWTRANS_H
#ifdef __cplusplus extern "C" { #endif
The sysdep.h file includes system-specific include files and flags for I/O to network and disk. The only reason for this file is that the Internet world is more complicated than Posix and ANSI.
#include "sysdep.h"
These are the transports describing this interface
#include "HTANSI.h" #include "HTLocal.h"
#include "HTTCP.h" #include "HTSocket.h" #include "HTReader.h" #include "HTWriter.h" #include "HTBufWrt.h"
#include "HTMux.h"
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */
The Basic Utility modules are mostly container modules, dynamic strings and other stuff that you can't live without when building applications. The modules are used by the core part of the W3C Reference Library but can also be used by the application. See also the main Library include file called WWWLib.h which contains all converters and protocol modules known to the Library. You can include this one if the application is to use all the functionality of the Library.
#ifndef WWWUTIL_H #define WWWUTIL_H
#ifdef __cplusplus extern "C" { #endif
The sysdep.h file includes system-specific include files and flags for I/O to network and disk. The only reason for this file is that the Internet world is more complicated than Posix and ANSI.
#include "sysdep.h"
This module includes file contains things we need everywhere, generally macros for declarations, booleans, etc.
#include "HTUtils.h"
This module implements a flexible array of pointers. It is a general utility module. An array is a structure which may be extended. These routines create and append data to arrays, automatically reallocating them as necessary. It is garanteed that the last entry in an array is NULL
#include "HTArray.h"
This is a small module build on top of the HTList module that provides a way to store Name-Value pairs in an easy way.
#include "HTAssoc.h"
Atoms are strings which are given representative pointer values so that they can be stored more efficiently, and comparisons for equality done more efficiently. The pointer values are in fact entries into a hash table.
#include "HTAtom.h"
A Chunk is a block wise expandable array of type (char *) and is a sort of apology for real strings in C. Chunks make it easier to handle dynamic strings of unknown size. It is often faster than using the String Copy Routines.
#include "HTChunk.h"
This module provides the functionality for managing a generic list of data objects. The module is implemented as a single linked list using the scheme first in - last out (FILO).
#include "HTList.h"
This module defines any memory handler to be used by libwww for allocating and de-allocating dynamic memory. As dynamic memory may be a scarce resource, it is required that an application can handle memory exhaustion gracefully.
#include "HTMemory.h"
Routines for dynamic arrays of characters include string copy, case insensitive comparison etc.
#include "HTString.h"
File module provides functions functions for uuencode and decode strings which convert a buffer of bytes to/from RFC 1113 printable encoding format. This technique is similar to the familiar Unix uuencode format in that it maps 6 binary bits to one ASCII character (or more aptly, 3 binary bytes to 4 ASCII characters). However, RFC 1113 does not use the same mapping to printable characters as uuencode.
#include "HTUU.h"
End of utility modules
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif
/* ** (c) COPYRIGHT MIT 1995. ** Please first read the full copyright statement in the file COPYRIGH. */This is the include file for the basic WAIS module that can be used together with the core of the W3C Reference Library. It contains all WAIS specific modules which are required to compile and build the WAIS DLL.
#ifndef WWWWAIS_H #define WWWWAIS_H
#ifdef __cplusplus extern "C" { #endif
#include "sysdep.h"
#include "HTWAIS.h" /* WAIS client state machine */End of WAIS module
#ifdef __cplusplus } /* end extern C definitions */ #endif #endif