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

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

Webmaster