1 /*********************************************************************************
\r
3 * --------------------------------------------------------------------------------
\r
5 * This file is part of MiMic
\r
6 * Copyright (C)2011 Ryo Iizuka
\r
8 * MiMic is free software: you can redistribute it and/or modify
\r
9 * it under the terms of the GNU Lesser General Public License as published
\r
10 * by the Free Software Foundation, either version 3 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU Lesser General Public License
\r
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
21 * For further information please contact.
\r
23 * <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
\r
25 *********************************************************************************/
\r
27 #ifndef NYLPC_CHTTPBODYWRITER_H_
\r
28 #define NYLPC_CHTTPBODYWRITER_H_
\r
30 #include "NyLPC_cHttpHeaderWriter.h"
\r
31 #include "NyLPC_cHttpStream.h"
\r
36 #endif /* __cplusplus */
\r
38 typedef struct NyLPC_TcHttpBodyWriter NyLPC_TcHttpBodyWriter_t;
\r
39 struct NyLPC_TcHttpBodyWriter
\r
41 NyLPC_TiHttpPtrStream_t* _ref_stream;
\r
42 NyLPC_TUInt8 _is_chunked;
\r
43 NyLPC_TUInt8 _is_error;
\r
44 NyLPC_TUInt32 _size_of_sent;
\r
45 /** _is_chunked==NyLPC_TUInt8_TRUEの時のみ有効. ContentLengthの値*/
\r
46 NyLPC_TUInt32 _content_length;
\r
50 * 送信モードの初期値は、contentlength=0,chunked無しです。
\r
52 void NyLPC_cHttpBodyWriter_initialize(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TcHttpStream_t* i_stream);
\r
53 #define NyLPC_cHttpBodyWriter_finalize(i);
\r
54 /** Chunkedエンコーディングで送信する場合*/
\r
55 void NyLPC_cHttpBodyWriter_setChunked(NyLPC_TcHttpBodyWriter_t* i_inst);
\r
56 /** Contentlengthで送信する場合*/
\r
57 void NyLPC_cHttpBodyWriter_setContentLength(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TUInt32 i_content_length);
\r
58 NyLPC_TBool NyLPC_cHttpBodyWriter_write(NyLPC_TcHttpBodyWriter_t* i_inst,const void* i_buf,NyLPC_TUInt32 i_len);
\r
59 NyLPC_TBool NyLPC_cHttpBodyWriter_close(NyLPC_TcHttpBodyWriter_t* i_inst);
\r
60 NyLPC_TBool NyLPC_cHttpBodyWriter_format(NyLPC_TcHttpBodyWriter_t* i_inst,const NyLPC_TChar* i_fmt,...);
\r
61 NyLPC_TBool NyLPC_cHttpBodyWriter_formatV(NyLPC_TcHttpBodyWriter_t* i_inst,const NyLPC_TChar* i_fmt,va_list i_args);
\r
67 #endif /* __cplusplus */
\r
69 #endif /* NYLPC_CHTTPBODYWRITER_H_ */
\r