1 /* /Net/dxcern/userd/timbl/hypertext/WWW/Library/Implementation/HTMIME.html 2 MIME PARSER 3 4 The MIME parser stream presents a MIME document. It recursively invokes the 5 format manager to handle embedded formats. 6 7 As well as stripping off and parsing the headers, the MIME parser has to 8 parse any weirld MIME encodings it may meet within the body parts of 9 messages, and must deal with multipart messages. 10 11 This module is implemented to the level necessary for operation with WWW, 12 but is not currently complete for any arbitrary MIME message. 13 14 Check the source for latest additions to functionality. 15 16 The MIME parser is complicated by the fact that WWW allows real binary to be 17 sent, not ASCII encoded. Therefore the netascii decoding is included in 18 this module. One cannot layer it by converting first from Net to local 19 text, then decoding it. Of course, for local files, the net ascii decoding 20 is not needed. There are therefore two creation routines. 21 22 */ 23 #ifndef HTMIME_H 24 #define HTMIME_H 25 26 #include <HTStream.h> 27 #include <HTAnchor.h> 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 /* 33 * This function is for trimming off any paired 34 * open- and close-double quotes from header values. 35 * It does not parse the string for embedded quotes, 36 * and will not modify the string unless both the 37 * first and last characters are double-quotes. - FM 38 */ extern void HTMIME_TrimDoubleQuotes(char *value); 39 40 /* 41 42 INPUT: LOCAL TEXT 43 44 */ 45 extern HTStream *HTMIMEConvert(HTPresentation *pres, 46 HTParentAnchor *anchor, 47 HTStream *sink); 48 49 /* 50 51 INPUT: NET ASCII 52 53 */ 54 extern HTStream *HTNetMIME(HTPresentation *pres, 55 HTParentAnchor *anchor, 56 HTStream *sink); 57 58 /* 59 60 INPUT: Redirection message, parse headers only for Location if present 61 62 */ 63 extern HTStream *HTMIMERedirect(HTPresentation *pres, 64 HTParentAnchor *anchor, 65 HTStream *sink); 66 67 /* 68 69 For handling Japanese headers. 70 71 */ 72 extern void HTmmdecode(char **target, 73 char *source); 74 75 extern int HTrjis(char **target, 76 char *source); 77 78 extern int HTmaybekanji(int c1, 79 int c2); 80 81 #ifdef __cplusplus 82 } 83 #endif 84 #endif /* !HTMIME_H */ 85