Annotation of libwww/Library/src/HTHeader.html, revision 2.14

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.8       eric        3:   <!-- Changed by: Henrik Frystyk Nielsen, 23-Mar-1996 -->
2.10      frystyk     4:   <!-- Changed by: Eric Prud'hommeaux, 28-May-1996 -->
2.8       eric        5:   <NEXTID N="z11">
2.11      frystyk     6:   <TITLE>W3C Sample Code Library libwww MIME Headers</TITLE>
2.1       frystyk     7: </HEAD>
                      8: <BODY>
2.8       eric        9: <H1>
2.10      frystyk    10:   MIME Headers
2.8       eric       11: </H1>
2.1       frystyk    12: <PRE>
                     13: /*
                     14: **     (c) COPYRIGHT MIT 1995.
                     15: **     Please first read the full copyright statement in the file COPYRIGH.
                     16: */
                     17: </PRE>
2.8       eric       18: <P>
                     19: This module handles lists of callback functions for generating and parsing
                     20: protocol headers. This works exactly like the lists in
                     21: <A HREF="HTFormat.html">HTFormat</A>.
                     22: <P>
2.10      frystyk    23: This module is implemented by <A HREF="HTHeader.c">HTHeader.c</A>, and it
2.12      frystyk    24: is a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
2.8       eric       25: Library</A>.
2.1       frystyk    26: <PRE>
                     27: #ifndef HTHEADER_H
                     28: #define HTHEADER_H
                     29: 
2.9       frystyk    30: #include "HTResponse.h"
2.1       frystyk    31: #include "HTStream.h"
2.14    ! vbancrof   32: 
        !            33: #ifdef __cplusplus
        !            34: extern "C" { 
        !            35: #endif 
2.1       frystyk    36: </PRE>
2.8       eric       37: <P>
                     38: We have two call back functions: the first is for generating headers. This
                     39: needs a stream to put down the extra headers. This one is defined in the
                     40: <A HREF="HTReq.html">Request Manager</A>. The other one is for parsing. This
                     41: needs the string to parse.
                     42: <PRE>
2.9       frystyk    43: typedef int HTParserCallback (HTRequest * request, HTResponse * response,
                     44:                               char * token, char * value);
2.8       eric       45: </PRE>
                     46: <H2>
                     47:   Header Parser Management
                     48: </H2>
                     49: <P>
2.10      frystyk    50: Header Parsers can be registered to handle any header. The standard set of
                     51: HTTP/1.1 MIME parsers is registered by HTMIMEInit in the
                     52: <A HREF="HTInit.html">HTInit</A> module. The HTParserCallbacks are called
                     53: by the <A HREF="HTMIME.html">HTMIME</A> module.
                     54: <P>
                     55: HTParserCallbacks may be registered for known MIME headers (HTParser_*),
                     56: or for regular expressions (HTRegexParser_*). To data the regex support is
                     57: limited to the use of '*' for a wild card.
2.8       eric       58: <H2>
                     59:   Header Generator Management
                     60: </H2>
                     61: <P>
                     62: Header Generators can be use to add additional information to aprotocol request.
                     63: They will all be called.
2.1       frystyk    64: <PRE>
                     65: extern BOOL HTGenerator_add (HTList * gens, HTPostCallback * callback);
                     66: extern BOOL HTGenerator_delete (HTList * gens, HTPostCallback * callback);
                     67: extern BOOL HTGenerator_deleteAll (HTList * gens);
                     68: </PRE>
2.8       eric       69: <H2>
                     70:   Global List Of Parsers and Generators
                     71: </H2>
                     72: <P>
                     73: As in <A HREF="HTFormat.html">HTFormat module</A> you can register a list
                     74: globally or locally as you like. The local registrations is managed by
                     75: <A HREF="HTReq.html">Request Manager</A>
                     76: <H3>
                     77:   Header Parsers
                     78: </H3>
2.1       frystyk    79: <PRE>
2.13      frystyk    80: #define MIME_HASH_SIZE  HT_L_HASH_SIZE
                     81: 
2.8       eric       82: extern void HTHeader_setMIMEParseSet (HTMIMEParseSet * list);
                     83: extern HTMIMEParseSet * HTHeader_MIMEParseSet (void);
2.5       frystyk    84: extern BOOL HTHeader_addParser (const char * token, BOOL case_sensitive,
2.3       frystyk    85:                                HTParserCallback * callback);
2.8       eric       86: extern BOOL HTHeader_addRegexParser (const char * token, BOOL case_sensitive,
                     87:                                HTParserCallback * callback);
2.5       frystyk    88: extern BOOL HTHeader_deleteParser (const char * token);
2.1       frystyk    89: </PRE>
2.8       eric       90: <H3>
                     91:   Header Generation
                     92: </H3>
2.1       frystyk    93: <PRE>
                     94: extern void HTHeader_setGenerator (HTList * list);
2.4       frystyk    95: extern BOOL HTHeader_addGenerator (HTPostCallback * callback);
                     96: extern BOOL HTHeader_deleteGenerator (HTPostCallback * callback);
2.1       frystyk    97: extern HTList * HTHeader_generator (void);
                     98: </PRE>
2.8       eric       99: <H3>
                    100:   Delete all Global Lists
                    101: </H3>
2.1       frystyk   102: <PRE>
                    103: extern void HTHeader_deleteAll (void);
                    104: </PRE>
                    105: <PRE>
2.14    ! vbancrof  106: #ifdef __cplusplus
        !           107: }
        !           108: #endif
        !           109: 
2.1       frystyk   110: #endif /* HTHEADER_H */
                    111: </PRE>
2.8       eric      112: <P>
                    113:   <HR>
2.7       frystyk   114: <ADDRESS>
2.14    ! vbancrof  115:   @(#) $Id: HTHeader.html,v 2.13 1999/02/07 18:20:31 frystyk Exp $
2.7       frystyk   116: </ADDRESS>
2.8       eric      117: </BODY></HTML>

Webmaster