Annotation of libwww/Library/src/HTMIME.html, revision 2.29

2.6       timbl       1: <HTML>
                      2: <HEAD>
2.24      frystyk     3:   <!-- Changed by: Henrik Frystyk Nielsen, 17-Apr-1996 -->
2.26      frystyk     4:   <TITLE>W3C Sample Code Library libwww MIME/RFC822 Parsers</TITLE>
2.6       timbl       5: </HEAD>
                      6: <BODY>
2.24      frystyk     7: <H1>
2.25      frystyk     8:   MIME Parsers
2.24      frystyk     9: </H1>
2.9       frystyk    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>
2.24      frystyk    16: <P>
                     17: The MIME parser stream presents a MIME document with a header and possibly
                     18: a footer. It recursively invokes the format manager to handle embedded formats
                     19: like MIME multipart. As well as stripping off and parsing the headers, the
                     20: MIME parser has to parse any weird MIME encodings it may meet within the
                     21: body parts of messages, and must deal with multipart messages.
                     22: <P>
                     23: This module is implemented to the level necessary for operation with WWW,
                     24: but is not currently complete for any arbitrary MIME message.
                     25: <P>
2.9       frystyk    26: This module is implemented by <A HREF="HTMIME.c">HTMIME.c</A>, and it is
2.28      frystyk    27: a part of the <A HREF="http://www.w3.org/Library/"> W3C Sample Code
2.24      frystyk    28: Library</A>.
2.9       frystyk    29: <PRE>
                     30: #ifndef HTMIME_H
2.1       timbl      31: #define HTMIME_H
                     32: 
                     33: #include "HTStream.h"
2.15      frystyk    34: #include "HTFormat.h"
2.6       timbl      35: </PRE>
2.24      frystyk    36: <H3>
2.29    ! frystyk    37:   How to deal with "application/octetstream" etc.
        !            38: </H3>
        !            39: <P>
        !            40: When the MIME parser can't find a target stream, for example because the
        !            41: format is application/octetstream, or it has a content encoding or
        !            42: transfer encoding that we don't know about then it has to get rid of the
        !            43: data in some other fashion, for example by dumping it to local disk. The
        !            44: following two functions allow you to set and get the local file save stream.
        !            45: <P>
        !            46: Libwww provides a default implementation as <A
        !            47: HREF="HTFSave.html">HTSaveLocally</A> which you may want to use.
        !            48: <PRE>
        !            49: extern void HTMIME_setSaveStream (HTConverter * save_stream);
        !            50: extern HTConverter * HTMIME_saveStream (void);
        !            51: </PRE>
        !            52: 
        !            53: <H3>
2.24      frystyk    54:   MIME header parser stream
                     55: </H3>
                     56: <P>
                     57: This stream parses a complete MIME header and if a content type header is
                     58: found then the stream stack is called. Any left over data is pumped right
                     59: through the stream.
2.8       frystyk    60: <PRE>
2.20      frystyk    61: extern HTConverter HTMIMEConvert;
2.18      frystyk    62: </PRE>
2.24      frystyk    63: <H3>
                     64:   MIME Header ONLY parser stream
                     65: </H3>
                     66: <P>
                     67: This stream parses a complete MIME header and then returnes HT_PAUSE. It
                     68: does not set up any streams and resting data stays in the buffer. This can
                     69: be used if you only want to parse the headers before you decide what to do
                     70: next. This is for example the case in a server app.
2.18      frystyk    71: <PRE>
2.20      frystyk    72: extern HTConverter HTMIMEHeader;
2.18      frystyk    73: </PRE>
2.24      frystyk    74: <H3>
                     75:   MIME Footer ONLY parser
                     76: </H3>
                     77: <P>
2.23      frystyk    78: Parse only a footer, for example after a chunked encoding.
2.18      frystyk    79: <PRE>
2.23      frystyk    80: extern HTConverter HTMIMEFooter;
                     81: </PRE>
2.25      frystyk    82: <H3>
2.27      frystyk    83:   MIME 1xx Continue Header Parser
                     84: </H3>
                     85: <P>
                     86: When parsed the header it returns HT_CONTINUE
                     87: <PRE>
                     88: extern HTConverter HTMIMEContinue;
                     89: </PRE>
                     90: <H3>
2.25      frystyk    91:   Partial MIME Response parser
                     92: </H3>
                     93: <P>
                     94: In case we sent a <I>Range conditional GET</I> we may get back a partial
                     95: response. This response must be appended to the already existing cache entry
                     96: before presented to the user. That is, first we load the cached object and
                     97: pump it down the pipe and then the new data follows. Only the latter part
                     98: gets appended to the cache, of course.
                     99: <PRE>
                    100: extern HTConverter HTMIMEPartial;
                    101: </PRE>
2.23      frystyk   102: <PRE>
2.1       timbl     103: #endif
2.8       frystyk   104: </PRE>
2.24      frystyk   105: <P>
                    106:   <HR>
2.22      frystyk   107: <ADDRESS>
2.29    ! frystyk   108:   @(#) $Id: HTMIME.html,v 2.28 1998/05/14 02:10:41 frystyk Exp $
2.22      frystyk   109: </ADDRESS>
2.24      frystyk   110: </BODY></HTML>

Webmaster