Annotation of libwww/Library/src/HTInit.html, revision 2.46

2.6       timbl       1: <HTML>
                      2: <HEAD>
2.43      frystyk     3: <!-- Changed by: Henrik Frystyk Nielsen, 13-Jul-1996 -->
2.36      frystyk     4:   <TITLE>W3C Reference Library libwww Default Initialization</TITLE>
2.6       timbl       5: </HEAD>
                      6: <BODY>
2.36      frystyk     7: <H1>
                      8:   Default Initialization Methods
                      9: </H1>
2.11      frystyk    10: <PRE>
                     11: /*
2.16      frystyk    12: **     (c) COPYRIGHT MIT 1995.
2.11      frystyk    13: **     Please first read the full copyright statement in the file COPYRIGH.
                     14: */
                     15: </PRE>
2.36      frystyk    16: <P>
                     17: As mentioned in the <A HREF="../User/Architecture/">Library Architecture</A>,
                     18: libwww consists of a small core and a large set of hooks for adding
                     19: functionality. By itself, the core it not capable of performing any Web related
                     20: tasks like accessing a HTTP server or parsing a HTML document. All this
                     21: functionality must be registered by the application. This way, the core of
                     22: libwww is kept application independent and can be used as the basic building
                     23: block for any kind of Web application. The Library comes with a large set
                     24: of default functions, for example for accessing HTTP and FTP servers, parsing
                     25: <A HREF="http://info.internet.isi.edu:80/in-notes/rfc/files/rfc822.txt">RFC
                     26: 822</A> headers etc. This module helps the application programmer setting
                     27: up all this functionality, but it is important to note that none of it is
                     28: <I>required</I> in order to use the Library.
                     29: <P>
                     30: This module is implemented by <A HREF="HTInit.c">HTInit.c</A>, and it is
                     31: a part of the <A HREF="http://www.w3.org/pub/WWW/Library/">W3C Reference
                     32: Library</A>. You can also have a look at the other
                     33: <A HREF="WWWInit.html">Initialization modules</A>.
2.9       frystyk    34: <PRE>
2.13      frystyk    35: #ifndef HTINIT_H
                     36: #define HTINIT_H
2.27      frystyk    37: #include "WWWLib.h"
2.37      eric       38: #include "WWWApp.h"
2.9       frystyk    39: </PRE>
2.36      frystyk    40: <H2>
                     41:   Default Transport Protocol Modules
                     42: </H2>
                     43: <P>
2.32      frystyk    44: Register the default set of transport protocols.
                     45: <PRE>
2.36      frystyk    46: #include "WWWTrans.h"
2.32      frystyk    47: 
                     48: extern void HTTransportInit (void);
                     49: </PRE>
2.36      frystyk    50: <H2>
                     51:   Default Protocol Modules
                     52: </H2>
                     53: <P>
                     54: Set up default bindings between access schemes and the set of protocol modules
2.43      frystyk    55: in the Library. The preemptive version registers all protocol modules to use blocking sockets.
2.32      frystyk    56: <PRE>
                     57: #include "WWWHTTP.h"
                     58: #include "WWWFile.h"
                     59: #include "WWWFTP.h"
                     60: #include "WWWGophe.h"
                     61: #include "WWWTelnt.h"
                     62: #include "WWWNews.h"
                     63: 
                     64: #ifdef HT_DIRECT_WAIS
                     65: #include "WWWWAIS.h"
                     66: #endif
                     67: 
2.41      frystyk    68: #define HTAccessInit   HTProtocolInit
2.43      frystyk    69: 
2.40      frystyk    70: extern void HTProtocolInit (void);
2.43      frystyk    71: 
                     72: extern void HTProtocolPreemptiveInit (void);
2.32      frystyk    73: </PRE>
2.36      frystyk    74: <H2>
2.40      frystyk    75:   <A NAME="MIME">Default MIME Parsers</A>
2.37      eric       76: </H2>
                     77: <P>
2.38      frystyk    78: The core doesn't have any built in MIME parsers, but many of the protocols
2.39      frystyk    79: need them. For instance, many elements of the library rely on the
2.42      frystyk    80: <CODE>Content-Length</CODE> being correctly set. <CODE>HTMIMEInit()</CODE>
                     81: provides the minimal functionality needed for library reliabilty.
2.40      frystyk    82: <PRE>
                     83: #include "WWWMIME.h"
                     84: #include "WWWApp.h"
                     85: 
                     86: extern void HTMIMEInit (void);
2.37      eric       87: </PRE>
                     88: <H2>
2.36      frystyk    89:   Default Event Manager
                     90: </H2>
                     91: <P>
2.39      frystyk    92: libwww core does not have any default event loop - it has to be added by
                     93: the application. However, it does come with an example implementation thta
                     94: may be used. This implementation is based on a <CODE>select</CODE> system
                     95: call using non-blocking and interleaved sockets.
2.35      frystyk    96: <PRE>
2.39      frystyk    97: #include "WWWApp.h"
2.35      frystyk    98: </PRE>
2.36      frystyk    99: <H2>
2.40      frystyk   100:   <A NAME="Converter">Default Media Type Conversions</A>
2.36      frystyk   101: </H2>
                    102: <P>
                    103: The <EM>Converters</EM> are used to convert a media type to another media
                    104: type, or to present it on screen. This is a part of the stream stack algorithm.
                    105: The Presenters are also used in the stream stack, but are initialized separately.
2.38      frystyk   106: <PRE>#include "WWWMIME.h"
2.32      frystyk   107: #include "WWWHTML.h"
                    108: #include "WWWStream.h"
                    109: #include "WWWDir.h"
2.46    ! frystyk   110: #include "WWWCache.h"
2.23      frystyk   111: 
2.21      frystyk   112: extern void HTConverterInit    (HTList * conversions);
2.14      frystyk   113: </PRE>
2.36      frystyk   114: <H3>
                    115:   Presenters
                    116: </H3>
                    117: <P>
                    118: The <EM>Presenters</EM> are used to present a media type to the use by calling
                    119: an external program, for example a post script viewer. This is a part of
                    120: the stream stack algorithm. The <I>Converters</I> are also used in the stream
                    121: stack, but are initialized separately. The <I>Presenters</I> use the same
                    122: include files as the <I>Converters</I>.
2.14      frystyk   123: <PRE>
2.21      frystyk   124: extern void HTPresenterInit    (HTList * conversions);
2.14      frystyk   125: </PRE>
2.36      frystyk   126: <H3>
                    127:   Converters and Presenters
                    128: </H3>
                    129: <P>
                    130: This function is only defined in order to preserve backward compatibility.
2.21      frystyk   131: <PRE>
                    132: extern void HTFormatInit       (HTList * conversions);
2.9       frystyk   133: </PRE>
2.36      frystyk   134: <H2>
                    135:   Default Content and Transfer Encodings
                    136: </H2>
                    137: <P>
                    138: Content encoders and decoders can handle encodings like <EM>chunked</EM>
                    139: etc.
2.42      frystyk   140: <PRE>#include "<A HREF="WWWHTTP.html">WWWHTTP.h</A>"
2.9       frystyk   141: 
2.33      frystyk   142: extern void HTEncoderInit      (HTList * encodings);
                    143: </PRE>
2.36      frystyk   144: <H2>
2.42      frystyk   145:   Default BEFORE and AFTER Filters
2.36      frystyk   146: </H2>
                    147: <P>
2.42      frystyk   148: This module provides a set of default <B>BEFORE</B> and <B>AFTER</B> filters
                    149: that can be registered by the <A HREF="HTNet.html">Net manager</A> to be
                    150: called before and after a request. All filters can be registered either to
                    151: be called <I>globally</I> (all requests) or <I>locally</I> (pr request basis).
                    152: <B>Not</B> done automaticly - may be done by application!
                    153: <H3>
                    154:   BEFORE Filters
                    155: </H3>
                    156: <P>
                    157: The <I>BEFORE</I> filters handle <I>proxies</I>, <I>caches</I>, <I>rule
                    158: files</I> etc. The filters are called in the order by which the are registered
                    159: <PRE>#include "<A HREF="WWWApp.html">WWWApp.h</A>"
2.33      frystyk   160: 
2.42      frystyk   161: extern void HTBeforeInit (void);
                    162: </PRE>
                    163: <H3>
                    164:   AFTER Filters
                    165: </H3>
                    166: <P>
                    167: The <I>AFTER</I> filters handle error messages, logging, redirection,
                    168: authentication etc. The filters are called in the order by which the are
                    169: registered
                    170: <PRE>extern void HTAfterInit (void);
                    171: </PRE>
                    172: <H3>
                    173:   BEFORE and AFTER Filters
                    174: </H3>
                    175: <P>
                    176: This is just a short cut for registrating both <I>BEFORE</I> and <I>AFTER</I>
                    177: at once
                    178: <PRE>extern void HTNetInit (void);
                    179: </PRE>
                    180: <H2>
                    181:   Default Access Authentication Modules
                    182: </H2>
                    183: <P>
                    184: The <A HREF="HTAAUtil.html">Access Manager</A> which is implemented as a
                    185: <I>BEFORE</I> and an <I>AFTER</I> filter (automatically registered in
                    186: <CODE>HTNetInit()</CODE>) does not by default know of any access authentication
                    187: schemes. As everything else, this must be registered! This function does
                    188: the job and should be all you need.
                    189: <PRE>extern void HTAAInit (void);
2.27      frystyk   190: </PRE>
2.36      frystyk   191: <H2>
                    192:   Default Message and Dialog Functions
                    193: </H2>
                    194: <P>
                    195: We register a set of alert messages Not done automaticly - may be done by
                    196: application!
2.42      frystyk   197: <PRE>#include "<A HREF="HTApp.html">WWWApp.h</A>"
2.27      frystyk   198: 
                    199: extern void HTAlertInit (void);
                    200: </PRE>
2.40      frystyk   201: <H2>
                    202:   Default Icons for Directory Listings
                    203: </H2>
                    204: <P>
2.42      frystyk   205: The <A HREF="WWWDir.html">WWWDir interface</A> contains support for including
                    206: references (URLs and <CODE>ALT</CODE> text tags) to icons in directory listings.
                    207: The icons are selected as a function of the media type and the content encoding
                    208: of the file in question. That is - you can set up icons for compressed files,
                    209: postscript files etc. There is also a small set of specific icons representing
                    210: directories etc.
2.40      frystyk   211: <PRE>#include "<A HREF="WWWFile.html">WWWFile.h</A>"
                    212: 
                    213: extern void HTIconInit (const char * url_prefix);
                    214: </PRE>
2.27      frystyk   215: <PRE>
2.13      frystyk   216: #endif
2.9       frystyk   217: </PRE>
2.36      frystyk   218: <P>
                    219:   <HR>
2.31      frystyk   220: <ADDRESS>
2.46    ! frystyk   221:   @(#) $Id: HTInit.html,v 2.45 1996/08/21 00:07:12 frystyk Exp $
2.31      frystyk   222: </ADDRESS>
2.36      frystyk   223: </BODY></HTML>

Webmaster