📄 htmime.h
字号:
/* W3C Sample Code Library libwww MIME/RFC822 Parsers! MIME Parsers!*//*** (c) COPYRIGHT MIT 1995.** Please first read the full copyright statement in the file COPYRIGH.*//*The MIME parser stream presents a MIME document with a header and possiblya footer. It recursively invokes the format manager to handle embedded formatslike MIME multipart. As well as stripping off and parsing the headers, theMIME parser has to parse any weird MIME encodings it may meet within thebody 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.This module is implemented by HTMIME.c, and it isa part of the W3C Sample CodeLibrary.*/#ifndef HTMIME_H#define HTMIME_H#include "HTStream.h"#include "HTFormat.h"/*( How to deal with "application/octetstream" etc.)When the MIME parser can't find a target stream, for example because theformat is application/octetstream, or it has a content encoding ortransfer encoding that we don't know about then it has to get rid of thedata in some other fashion, for example by dumping it to local disk. Thefollowing two functions allow you to set and get the local file save stream.Libwww provides a default implementation as HTSaveLocally which you may want to use.*/extern void HTMIME_setSaveStream (HTConverter * save_stream);extern HTConverter * HTMIME_saveStream (void);/*( MIME header parser stream)This stream parses a complete MIME header and if a content type header isfound then the stream stack is called. Any left over data is pumped rightthrough the stream.*/extern HTConverter HTMIMEConvert;/*( MIME Header ONLY parser stream)This stream parses a complete MIME header and then returnes HT_PAUSE. Itdoes not set up any streams and resting data stays in the buffer. This canbe used if you only want to parse the headers before you decide what to donext. This is for example the case in a server app.*/extern HTConverter HTMIMEHeader;/*( MIME Footer ONLY parser)Parse only a footer, for example after a chunked encoding.*/extern HTConverter HTMIMEFooter;/*( MIME 1xx Continue Header Parser)When parsed the header it returns HT_CONTINUE*/extern HTConverter HTMIMEContinue;/*( Partial MIME Response parser)In case we sent a Range conditional GET we may get back a partialresponse. This response must be appended to the already existing cache entrybefore presented to the user. That is, first we load the cached object andpump it down the pipe and then the new data follows. Only the latter partgets appended to the cache, of course.*/extern HTConverter HTMIMEPartial;/**/#endif/* @(#) $Id: HTMIME.html,v 2.29 1999/02/07 18:29:05 frystyk Exp $*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -