Annotation of libwww/Library/src/HTInit.html, revision 2.42
2.6 timbl 1: <HTML>
2: <HEAD>
2.42 ! frystyk 3: <!-- Changed by: Henrik Frystyk Nielsen, 3-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
55: in the Library.
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.40 frystyk 69: extern void HTProtocolInit (void);
2.32 frystyk 70: </PRE>
2.36 frystyk 71: <H2>
2.40 frystyk 72: <A NAME="MIME">Default MIME Parsers</A>
2.37 eric 73: </H2>
74: <P>
2.38 frystyk 75: The core doesn't have any built in MIME parsers, but many of the protocols
2.39 frystyk 76: need them. For instance, many elements of the library rely on the
2.42 ! frystyk 77: <CODE>Content-Length</CODE> being correctly set. <CODE>HTMIMEInit()</CODE>
! 78: provides the minimal functionality needed for library reliabilty.
2.40 frystyk 79: <PRE>
80: #include "WWWMIME.h"
81: #include "WWWApp.h"
82:
83: extern void HTMIMEInit (void);
2.37 eric 84: </PRE>
85: <H2>
2.36 frystyk 86: Default Event Manager
87: </H2>
88: <P>
2.39 frystyk 89: libwww core does not have any default event loop - it has to be added by
90: the application. However, it does come with an example implementation thta
91: may be used. This implementation is based on a <CODE>select</CODE> system
92: call using non-blocking and interleaved sockets.
2.35 frystyk 93: <PRE>
2.39 frystyk 94: #include "WWWApp.h"
95:
96: extern void HTEventInit (void);
2.35 frystyk 97: </PRE>
2.36 frystyk 98: <H2>
2.40 frystyk 99: <A NAME="Converter">Default Media Type Conversions</A>
2.36 frystyk 100: </H2>
101: <P>
102: The <EM>Converters</EM> are used to convert a media type to another media
103: type, or to present it on screen. This is a part of the stream stack algorithm.
104: The Presenters are also used in the stream stack, but are initialized separately.
2.38 frystyk 105: <PRE>#include "WWWMIME.h"
2.32 frystyk 106: #include "WWWHTML.h"
107: #include "WWWStream.h"
108: #include "WWWDir.h"
109: #include "WWWRules.h"
2.23 frystyk 110:
2.21 frystyk 111: extern void HTConverterInit (HTList * conversions);
2.14 frystyk 112: </PRE>
2.36 frystyk 113: <H3>
114: Presenters
115: </H3>
116: <P>
117: The <EM>Presenters</EM> are used to present a media type to the use by calling
118: an external program, for example a post script viewer. This is a part of
119: the stream stack algorithm. The <I>Converters</I> are also used in the stream
120: stack, but are initialized separately. The <I>Presenters</I> use the same
121: include files as the <I>Converters</I>.
2.14 frystyk 122: <PRE>
2.21 frystyk 123: extern void HTPresenterInit (HTList * conversions);
2.14 frystyk 124: </PRE>
2.36 frystyk 125: <H3>
126: Converters and Presenters
127: </H3>
128: <P>
129: This function is only defined in order to preserve backward compatibility.
2.21 frystyk 130: <PRE>
131: extern void HTFormatInit (HTList * conversions);
2.9 frystyk 132: </PRE>
2.36 frystyk 133: <H2>
134: Default Content and Transfer Encodings
135: </H2>
136: <P>
137: Content encoders and decoders can handle encodings like <EM>chunked</EM>
138: etc.
2.42 ! frystyk 139: <PRE>#include "<A HREF="WWWHTTP.html">WWWHTTP.h</A>"
2.9 frystyk 140:
2.33 frystyk 141: extern void HTEncoderInit (HTList * encodings);
142: </PRE>
2.36 frystyk 143: <H2>
2.42 ! frystyk 144: Default BEFORE and AFTER Filters
2.36 frystyk 145: </H2>
146: <P>
2.42 ! frystyk 147: This module provides a set of default <B>BEFORE</B> and <B>AFTER</B> filters
! 148: that can be registered by the <A HREF="HTNet.html">Net manager</A> to be
! 149: called before and after a request. All filters can be registered either to
! 150: be called <I>globally</I> (all requests) or <I>locally</I> (pr request basis).
! 151: <B>Not</B> done automaticly - may be done by application!
! 152: <H3>
! 153: BEFORE Filters
! 154: </H3>
! 155: <P>
! 156: The <I>BEFORE</I> filters handle <I>proxies</I>, <I>caches</I>, <I>rule
! 157: files</I> etc. The filters are called in the order by which the are registered
! 158: <PRE>#include "<A HREF="WWWApp.html">WWWApp.h</A>"
2.33 frystyk 159:
2.42 ! frystyk 160: extern void HTBeforeInit (void);
! 161: </PRE>
! 162: <H3>
! 163: AFTER Filters
! 164: </H3>
! 165: <P>
! 166: The <I>AFTER</I> filters handle error messages, logging, redirection,
! 167: authentication etc. The filters are called in the order by which the are
! 168: registered
! 169: <PRE>extern void HTAfterInit (void);
! 170: </PRE>
! 171: <H3>
! 172: BEFORE and AFTER Filters
! 173: </H3>
! 174: <P>
! 175: This is just a short cut for registrating both <I>BEFORE</I> and <I>AFTER</I>
! 176: at once
! 177: <PRE>extern void HTNetInit (void);
! 178: </PRE>
! 179: <H2>
! 180: Default Access Authentication Modules
! 181: </H2>
! 182: <P>
! 183: The <A HREF="HTAAUtil.html">Access Manager</A> which is implemented as a
! 184: <I>BEFORE</I> and an <I>AFTER</I> filter (automatically registered in
! 185: <CODE>HTNetInit()</CODE>) does not by default know of any access authentication
! 186: schemes. As everything else, this must be registered! This function does
! 187: the job and should be all you need.
! 188: <PRE>extern void HTAAInit (void);
2.27 frystyk 189: </PRE>
2.36 frystyk 190: <H2>
191: Default Message and Dialog Functions
192: </H2>
193: <P>
194: We register a set of alert messages Not done automaticly - may be done by
195: application!
2.42 ! frystyk 196: <PRE>#include "<A HREF="HTApp.html">WWWApp.h</A>"
2.27 frystyk 197:
198: extern void HTAlertInit (void);
199: </PRE>
2.40 frystyk 200: <H2>
201: Default Icons for Directory Listings
202: </H2>
203: <P>
2.42 ! frystyk 204: The <A HREF="WWWDir.html">WWWDir interface</A> contains support for including
! 205: references (URLs and <CODE>ALT</CODE> text tags) to icons in directory listings.
! 206: The icons are selected as a function of the media type and the content encoding
! 207: of the file in question. That is - you can set up icons for compressed files,
! 208: postscript files etc. There is also a small set of specific icons representing
! 209: directories etc.
2.40 frystyk 210: <PRE>#include "<A HREF="WWWFile.html">WWWFile.h</A>"
211:
212: extern void HTIconInit (const char * url_prefix);
213: </PRE>
2.27 frystyk 214: <PRE>
2.13 frystyk 215: #endif
2.9 frystyk 216: </PRE>
2.36 frystyk 217: <P>
218: <HR>
2.31 frystyk 219: <ADDRESS>
2.42 ! frystyk 220: @(#) $Id: HTInit.html,v 2.41 1996/07/04 18:40:20 frystyk Exp $
2.31 frystyk 221: </ADDRESS>
2.36 frystyk 222: </BODY></HTML>
Webmaster