Non-Mandatory Application Include File

/*
**	(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

Initialization

The core parts of the Library is a framework for adding functionality. It has hooks for adding protocol modules, like for example HTTP, FTP, and also for adding streams that can convert from one media type to some other type, or presenting the result to the user. In the distribution file of the Library you will find a large set of protocol modules and streams already implemented. However, in order to use these you need to initialize them. This can be done by using the files in the HTInit module. You can modify this module as you like to fit your particular needs.
#include "HTInit.h"

Generating the First Anchor

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"

Before a Request

After a request has been issued there are a number of things that an application might want to do with the request before it actually goes on the wire, for example to talk to a remote HTTP server. Examples are checking if the object already is kept in a cache managed by the application, if the request should be redirected to a proxy or a gateway, or there is some other kind of translation of the URL taking place. The Library provides a variety of modules that handles many common place translations such as redirection of URLs and caching.

These modules are not part of the Library Core as the registration process depends on the application. It can for example use a database or some other means of registering translation rules, proxy servers. etc. The Library implementations are deliberately made as platform independent as possible and will cover most situations.

Rule File Management

Another way to initialize applications is to use a rule file, also known as a configuration file. This is for example the case with the W3C httpd and the W3C Line Mode Browser. This module provides basic support for configuration file management and the application can use this is desired. The module is not referred to by the Library. Reading a rule file is implemented as a stream converter so that a rule file can come from anywhere, even across the network!
#include "HTRules.h"

Proxies and Gateways

Applications do not have to provide native support for all protocols, they can in many situations rely on the support of proxies and gateways to help doing the job. Proxy servers are often used to carry client requests through a firewall where they can provide services like corporate caching and other network optimizations. Both Proxy servers and gateways can serve as "protocol translators" which can convert a request in the main Web protocol, HTTP, to an equivalent request in another protocol, for example NNTP, FTP, or Gopher. In case a proxy server or a gateway is available to the application, it can therefore by use of HTTP forward all requests to for example a proxy server which then handle the communications with the remote server, for example using FTP about the document and return it to the application (proxy client) using HTTP.
#include "HTProxy.h"

Cache Manager

Caching is a required part of any efficient Internet access applications as it saves bandwidth and improves access performance significantly in almost all types of accesses. The Library supports two different types of cache: The memory cache and the file cache. The two types differ in several ways which reflects their two main purposes: The memory cache is for short term storage of graphic objects whereas the file cache is for intermediate term storage of data objects. Often it is desirable to have both a memory and a file version of a cached document, so the two types do not exclude each other.
#include "HTCache.h"

After a Request

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

Logging

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"

History Management

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
End of WWWAPP definition