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

2.1     ! frystyk     1: <HTML>
        !             2: <HEAD>
        !             3: <TITLE>Extra Header Manager</TITLE>
        !             4: <!-- Changed by: Henrik Frystyk Nielsen,  3-Nov-1995 -->
        !             5: <NEXTID N="z11">
        !             6: </HEAD>
        !             7: <BODY>
        !             8: 
        !             9: <H1>Extra Header Manager</H1>
        !            10: 
        !            11: <PRE>
        !            12: /*
        !            13: **     (c) COPYRIGHT MIT 1995.
        !            14: **     Please first read the full copyright statement in the file COPYRIGH.
        !            15: */
        !            16: </PRE>
        !            17: 
        !            18: This module handles lists of callback functions for generating and
        !            19: parsing protocol headers. This works exactly like the lists in <A
        !            20: HREF="HTFormat.html">HTFormat</A>.<P>
        !            21: 
        !            22: This module is implemented by <A HREF="HTheader.c">HTheader.c</A>, and
        !            23: it is a part of the <A HREF="http://www.w3.org/pub/WWW/Library/"> W3C
        !            24: Reference Library</A>. <P>
        !            25: 
        !            26: <PRE>
        !            27: #ifndef HTHEADER_H
        !            28: #define HTHEADER_H
        !            29: 
        !            30: #include "HTReq.h"
        !            31: #include "HTStream.h"
        !            32: </PRE>
        !            33: 
        !            34: We have two call back functions: the first is for generating
        !            35: headers. This needs a stream to put down the extra headers. This one
        !            36: is defined in the <A HREF="HTReq.html">Request Manager</A>. The other
        !            37: one is for parsing. This needs the string to parse.
        !            38: 
        !            39: <PRE>
        !            40: typedef int HTParserCallback (HTRequest * request, CONST char * token);
        !            41: </PRE>
        !            42: 
        !            43: <H2>Header Parser Management</H3>
        !            44: 
        !            45: Header Parsers can be registered to handle any header that is not part
        !            46: of the "default set" handled by the <A HREF="HTMIME.html">HTMIME
        !            47: module</A>. This is mainlu the set defined by HTTP/1.1.
        !            48: 
        !            49: <H3>Add a Header Parser</H3>
        !            50: 
        !            51: Register a Header parser to be called if we encounter the token in teh
        !            52: protocol response. Tokens can contain a wildcard '*' which will match
        !            53: zero or more arbritary chars.
        !            54: 
        !            55: <PRE>
        !            56: extern BOOL HTParser_add (HTList *             parsers,
        !            57:                          CONST char *          token,
        !            58:                          BOOL                  case_sensitive,
        !            59:                          HTParserCallback *    callback);
        !            60: </PRE>
        !            61: 
        !            62: <H3>Unregister a Header parser</H3>
        !            63: 
        !            64: <PRE>
        !            65: extern BOOL HTParser_delete (HTList * parsers, CONST char * token);
        !            66: </PRE>
        !            67: 
        !            68: <H3>Delete the list of registered header parsers.</H3>
        !            69: 
        !            70: <PRE>
        !            71: extern BOOL HTParser_deleteAll (HTList * parsers);
        !            72: </PRE>
        !            73: 
        !            74: <H3>Find a parser</H3>
        !            75: 
        !            76: Search registered parsers to find suitable one for this token If a
        !            77: parser isn't found, the function returns NULL
        !            78: 
        !            79: <PRE>
        !            80: extern HTParserCallback * HTParser_find (HTList *parsers, CONST char * token);
        !            81: </PRE>
        !            82: 
        !            83: <H2>Header Generator Management</H2>
        !            84: 
        !            85: Header Generators can be use to add additional information to
        !            86: aprotocol request. They will all be called.
        !            87: 
        !            88: <H3>Add a Header Generator</H3>
        !            89: 
        !            90: <PRE>
        !            91: extern BOOL HTGenerator_add (HTList * gens, HTPostCallback * callback);
        !            92: </PRE>
        !            93: 
        !            94: <H3>Unregister a Header generator</H3>
        !            95: 
        !            96: <PRE>
        !            97: extern BOOL HTGenerator_delete (HTList * gens, HTPostCallback * callback);
        !            98: </PRE>
        !            99: 
        !           100: <H3>Delete the list of registered header generators.</H3>
        !           101: 
        !           102: <PRE>
        !           103: extern BOOL HTGenerator_deleteAll (HTList * gens);
        !           104: </PRE>
        !           105: 
        !           106: 
        !           107: <H2>Global List Of Parsers and Generators</H2>
        !           108: 
        !           109: As in <A HREF="HTFormat.html">HTFormat module</A> you can register a
        !           110: list globally or locally as you like. The local registrations is
        !           111: managed by <A HREF="HTReq.html">Request Manager</A>
        !           112: 
        !           113: <H3>Header Parsers</H3>
        !           114: 
        !           115: <PRE>
        !           116: extern void HTHeader_setParser (HTList * list);
        !           117: extern HTList * HTHeader_parser (void);
        !           118: </PRE>
        !           119: 
        !           120: <H3>Header Generation</H3>
        !           121: 
        !           122: <PRE>
        !           123: extern void HTHeader_setGenerator (HTList * list);
        !           124: extern HTList * HTHeader_generator (void);
        !           125: </PRE>
        !           126: 
        !           127: <H3>Delete all Global Lists</H3>
        !           128: 
        !           129: <PRE>
        !           130: extern void HTHeader_deleteAll (void);
        !           131: </PRE>
        !           132: 
        !           133: <PRE>
        !           134: #endif /* HTHEADER_H */
        !           135: </PRE>
        !           136: 
        !           137: End of Declaration
        !           138: 
        !           139: </BODY>
        !           140: </HTML>

Webmaster