This is Webservice SDK for mbed. LPCXpresso1769/LPC1768/FRDM-K64F/LPC4088

Dependents:   MbedFileServer_1768MiniDK2 RedWireBridge IssueDebug_gcc MiMicRemoteMCU-for-Mbed ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers NyLPC_cHttpBodyWriter.h Source File

NyLPC_cHttpBodyWriter.h

00001 /*********************************************************************************
00002  * PROJECT: MiMic
00003  * --------------------------------------------------------------------------------
00004  *
00005  * This file is part of MiMic
00006  * Copyright (C)2011 Ryo Iizuka
00007  *
00008  * MiMic is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License as published
00010  * by the Free Software Foundation, either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public License
00019  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00020  *
00021  * For further information please contact.
00022  *  http://nyatla.jp/
00023  *  <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>
00024  *
00025  *********************************************************************************/
00026 
00027 #ifndef NYLPC_CHTTPBODYWRITER_H_
00028 #define NYLPC_CHTTPBODYWRITER_H_
00029 
00030 #include "NyLPC_cHttpHeaderWriter.h"
00031 #include "NyLPC_cHttpStream.h"
00032 #include <stdarg.h>
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif /* __cplusplus */
00037 
00038 typedef struct NyLPC_TcHttpBodyWriter NyLPC_TcHttpBodyWriter_t;
00039 struct NyLPC_TcHttpBodyWriter
00040 {
00041     NyLPC_TiHttpPtrStream_t* _ref_stream;
00042     NyLPC_TUInt8 _is_chunked;
00043     NyLPC_TUInt8 _is_error;
00044     NyLPC_TUInt32 _size_of_sent;
00045     /** _is_chunked==NyLPC_TUInt8_TRUEの時のみ有効. ContentLengthの値*/
00046     NyLPC_TUInt32 _content_length;
00047 };
00048 
00049 /**
00050  * 送信モードの初期値は、contentlength=0,chunked無しです。
00051  */
00052 void NyLPC_cHttpBodyWriter_initialize(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TcHttpStream_t* i_stream);
00053 #define NyLPC_cHttpBodyWriter_finalize(i);
00054 /** Chunkedエンコーディングで送信する場合*/
00055 void NyLPC_cHttpBodyWriter_setChunked(NyLPC_TcHttpBodyWriter_t* i_inst);
00056 /** Contentlengthで送信する場合*/
00057 void NyLPC_cHttpBodyWriter_setContentLength(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TUInt32 i_content_length);
00058 NyLPC_TBool NyLPC_cHttpBodyWriter_write(NyLPC_TcHttpBodyWriter_t* i_inst,const void* i_buf,NyLPC_TUInt32 i_len);
00059 NyLPC_TBool NyLPC_cHttpBodyWriter_close(NyLPC_TcHttpBodyWriter_t* i_inst);
00060 NyLPC_TBool NyLPC_cHttpBodyWriter_format(NyLPC_TcHttpBodyWriter_t* i_inst,const NyLPC_TChar* i_fmt,...);
00061 NyLPC_TBool NyLPC_cHttpBodyWriter_formatV(NyLPC_TcHttpBodyWriter_t* i_inst,const NyLPC_TChar* i_fmt,va_list i_args);
00062 
00063 
00064 
00065 #ifdef __cplusplus
00066 }
00067 #endif /* __cplusplus */
00068 
00069 #endif /* NYLPC_CHTTPBODYWRITER_H_ */