Annotation of libwww/Library/src/HTInit.html, revision 2.43
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"
98:
99: extern void HTEventInit (void);
2.35 frystyk 100: </PRE>
2.36 frystyk 101: <H2>
2.40 frystyk 102: <A NAME="Converter">Default Media Type Conversions</A>
2.36 frystyk 103: </H2>
104: <P>
105: The <EM>Converters</EM> are used to convert a media type to another media
106: type, or to present it on screen. This is a part of the stream stack algorithm.
107: The Presenters are also used in the stream stack, but are initialized separately.
2.38 frystyk 108: <PRE>#include "WWWMIME.h"
2.32 frystyk 109: #include "WWWHTML.h"
110: #include "WWWStream.h"
111: #include "WWWDir.h"
112: #include "WWWRules.h"
2.23 frystyk 113:
2.21 frystyk 114: extern void HTConverterInit (HTList * conversions);
2.14 frystyk 115: </PRE>
2.36 frystyk 116: <H3>
117: Presenters
118: </H3>
119: <P>
120: The <EM>Presenters</EM> are used to present a media type to the use by calling
121: an external program, for example a post script viewer. This is a part of
122: the stream stack algorithm. The <I>Converters</I> are also used in the stream
123: stack, but are initialized separately. The <I>Presenters</I> use the same
124: include files as the <I>Converters</I>.
2.14 frystyk 125: <PRE>
2.21 frystyk 126: extern void HTPresenterInit (HTList * conversions);
2.14 frystyk 127: </PRE>
2.36 frystyk 128: <H3>
129: Converters and Presenters
130: </H3>
131: <P>
132: This function is only defined in order to preserve backward compatibility.
2.21 frystyk 133: <PRE>
134: extern void HTFormatInit (HTList * conversions);
2.9 frystyk 135: </PRE>
2.36 frystyk 136: <H2>
137: Default Content and Transfer Encodings
138: </H2>
139: <P>
140: Content encoders and decoders can handle encodings like <EM>chunked</EM>
141: etc.
2.42 frystyk 142: <PRE>#include "<A HREF="WWWHTTP.html">WWWHTTP.h</A>"
2.9 frystyk 143:
2.33 frystyk 144: extern void HTEncoderInit (HTList * encodings);
145: </PRE>
2.36 frystyk 146: <H2>
2.42 frystyk 147: Default BEFORE and AFTER Filters
2.36 frystyk 148: </H2>
149: <P>
2.42 frystyk 150: This module provides a set of default <B>BEFORE</B> and <B>AFTER</B> filters
151: that can be registered by the <A HREF="HTNet.html">Net manager</A> to be
152: called before and after a request. All filters can be registered either to
153: be called <I>globally</I> (all requests) or <I>locally</I> (pr request basis).
154: <B>Not</B> done automaticly - may be done by application!
155: <H3>
156: BEFORE Filters
157: </H3>
158: <P>
159: The <I>BEFORE</I> filters handle <I>proxies</I>, <I>caches</I>, <I>rule
160: files</I> etc. The filters are called in the order by which the are registered
161: <PRE>#include "<A HREF="WWWApp.html">WWWApp.h</A>"
2.33 frystyk 162:
2.42 frystyk 163: extern void HTBeforeInit (void);
164: </PRE>
165: <H3>
166: AFTER Filters
167: </H3>
168: <P>
169: The <I>AFTER</I> filters handle error messages, logging, redirection,
170: authentication etc. The filters are called in the order by which the are
171: registered
172: <PRE>extern void HTAfterInit (void);
173: </PRE>
174: <H3>
175: BEFORE and AFTER Filters
176: </H3>
177: <P>
178: This is just a short cut for registrating both <I>BEFORE</I> and <I>AFTER</I>
179: at once
180: <PRE>extern void HTNetInit (void);
181: </PRE>
182: <H2>
183: Default Access Authentication Modules
184: </H2>
185: <P>
186: The <A HREF="HTAAUtil.html">Access Manager</A> which is implemented as a
187: <I>BEFORE</I> and an <I>AFTER</I> filter (automatically registered in
188: <CODE>HTNetInit()</CODE>) does not by default know of any access authentication
189: schemes. As everything else, this must be registered! This function does
190: the job and should be all you need.
191: <PRE>extern void HTAAInit (void);
2.27 frystyk 192: </PRE>
2.36 frystyk 193: <H2>
194: Default Message and Dialog Functions
195: </H2>
196: <P>
197: We register a set of alert messages Not done automaticly - may be done by
198: application!
2.42 frystyk 199: <PRE>#include "<A HREF="HTApp.html">WWWApp.h</A>"
2.27 frystyk 200:
201: extern void HTAlertInit (void);
202: </PRE>
2.40 frystyk 203: <H2>
204: Default Icons for Directory Listings
205: </H2>
206: <P>
2.42 frystyk 207: The <A HREF="WWWDir.html">WWWDir interface</A> contains support for including
208: references (URLs and <CODE>ALT</CODE> text tags) to icons in directory listings.
209: The icons are selected as a function of the media type and the content encoding
210: of the file in question. That is - you can set up icons for compressed files,
211: postscript files etc. There is also a small set of specific icons representing
212: directories etc.
2.40 frystyk 213: <PRE>#include "<A HREF="WWWFile.html">WWWFile.h</A>"
214:
215: extern void HTIconInit (const char * url_prefix);
216: </PRE>
2.27 frystyk 217: <PRE>
2.13 frystyk 218: #endif
2.9 frystyk 219: </PRE>
2.36 frystyk 220: <P>
221: <HR>
2.31 frystyk 222: <ADDRESS>
2.43 ! frystyk 223: @(#) $Id: HTInit.html,v 2.42 1996/07/08 19:10:48 frystyk Exp $
2.31 frystyk 224: </ADDRESS>
2.36 frystyk 225: </BODY></HTML>
Webmaster