Annotation of libwww/Library/src/HTMIME.html, revision 2.18
2.6 timbl 1: <HTML>
2: <HEAD>
2.16 frystyk 3: <TITLE>RFC822 Header Parser</TITLE>
2.18 ! frystyk 4: <!-- Changed by: Henrik Frystyk Nielsen, 15-Sep-1995 -->
2.6 timbl 5: </HEAD>
6: <BODY>
2.9 frystyk 7:
8: <H1>MIME Parser</H1>
9:
10: <PRE>
11: /*
2.13 frystyk 12: ** (c) COPYRIGHT MIT 1995.
2.9 frystyk 13: ** Please first read the full copyright statement in the file COPYRIGH.
14: */
15: </PRE>
16:
17: The MIME parser stream presents a MIME document. It recursively
18: invokes the format manager to handle embedded formats.<P>
19:
20: As well as stripping off and parsing the headers, the MIME parser has
21: to parse any weirld MIME encodings it may meet within the body parts
22: of messages, and must deal with multipart messages. <P>
23:
24: This module is implemented to the level necessary for operation with
25: WWW, but is not currently complete for any arbitrary MIME message.<P>
26:
27: Check the <A NAME="z0" HREF="HTMIME.c">source</A> for latest additions
28: to functionality.<P> The MIME parser is complicated by the fact that
29: WWW allows real binary to be sent, not ASCII encoded. Therefore the
30: netascii decoding is included in this module. One cannot layer it by
31: converting first from Net to local text, then decoding it. Of course,
32: for local files, the net ascii decoding is not needed. There are
33: therefore two creation routines. <P>
34:
35: This module is implemented by <A HREF="HTMIME.c">HTMIME.c</A>, and it is
36: a part of the <A
2.17 frystyk 37: HREF="http://www.w3.org/pub/WWW/Library/">
2.14 frystyk 38: W3C Reference Library</A>.
2.9 frystyk 39:
40: <PRE>
41: #ifndef HTMIME_H
2.1 timbl 42: #define HTMIME_H
43:
44: #include "HTStream.h"
2.15 frystyk 45: #include "HTFormat.h"
2.6 timbl 46: </PRE>
2.7 timbl 47:
2.8 frystyk 48: <H3>Converters in this Module</H3>
2.1 timbl 49:
2.8 frystyk 50: <PRE>
2.11 frystyk 51: #ifndef pyramid
2.8 frystyk 52: extern HTConverter HTMIMEConvert, HTNetMIME;
53: #endif
2.18 ! frystyk 54: </PRE>
! 55:
! 56: <H2>Handling Unknown Headers</H2>
2.1 timbl 57:
2.18 ! frystyk 58: If you have additional headers that you want to experient with you can
! 59: register a header parser to handle all unknown headers. This handler
! 60: is called whenever an unknown header is encountered when parsing the
! 61: object header. If the returns YES then the MIME parser stores the
! 62: metainformation in the anchor object ifself so that it can be found at
! 63: a later point in time. If the handler returns NO, then the header is
! 64: discarded.<P>
! 65:
! 66: The header passed to the call back function will be in normal NULL
! 67: terminated C string without any CRLF. The line will also be unwrapped
! 68: so that it is easier to parse for the call back function.
! 69:
! 70: <PRE>
! 71: typedef BOOL HTMIMEHandler (HTRequest * request, char * header);
! 72:
! 73: extern BOOL HTMIME_register (HTMIMEHandler * cbf);
! 74: extern BOOL HTMIME_unRegister (void);
! 75: </PRE>
! 76:
! 77: <PRE>
2.1 timbl 78: #endif
2.8 frystyk 79: </PRE>
2.1 timbl 80:
2.8 frystyk 81: End of HTMIME
82: </BODY>
2.6 timbl 83: </HTML>
Webmaster