MIME Parser

/*
**	(c) COPYRIGHT MIT 1995.
**	Please first read the full copyright statement in the file COPYRIGH.
*/
The MIME parser stream presents a MIME document. It recursively invokes the format manager to handle embedded formats.

As well as stripping off and parsing the headers, the MIME parser has to parse any weirld MIME encodings it may meet within the body parts of messages, and must deal with multipart messages.

This module is implemented to the level necessary for operation with WWW, but is not currently complete for any arbitrary MIME message.

Check the source for latest additions to functionality.

The MIME parser is complicated by the fact that WWW allows real binary to be sent, not ASCII encoded. Therefore the netascii decoding is included in this module. One cannot layer it by converting first from Net to local text, then decoding it. Of course, for local files, the net ascii decoding is not needed. There are therefore two creation routines.

This module is implemented by HTMIME.c, and it is a part of the W3C Reference Library.

#ifndef HTMIME_H
#define HTMIME_H

#include "HTStream.h"
#include "HTFormat.h"

Converters in this Module

extern HTConverter HTMIMEConvert, HTNetMIME;

Handling Unknown Headers

If you have additional headers that you want to experient with you can register a header parser to handle all unknown headers. This handler is called whenever an unknown header is encountered when parsing the object header. If the returns YES then the MIME parser stores the metainformation in the anchor object ifself so that it can be found at a later point in time. If the handler returns NO, then the header is discarded.

The header passed to the call back function will be in normal NULL terminated C string without any CRLF. The line will also be unwrapped so that it is easier to parse for the call back function.

typedef BOOL HTMIMEHandler	(HTRequest * request, char * header);
 
extern BOOL HTMIME_register	(HTMIMEHandler * cbf);
extern BOOL HTMIME_unRegister	(void);
#endif
End of HTMIME