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
26 #ifndef NyLPC_TcHttpStream_h
\r
27 #define NyLPC_TcHttpStream_h
\r
29 #include "NyLPC_config.h"
\r
30 #include "NyLPC_iHttpPtrStream.h"
\r
34 #if NyLPC_CONFIG_cHttpStream_DEBUG == 1
\r
37 #endif /* __cplusplus */
\r
39 typedef int NyLPC_TcTcpSocket_t;
\r
40 void NyLPC_cTcpSocket_initialized(void* inst,const char* rb,int l);
\r
41 void* NyLPC_cTcpSocket_allocSendBuf(void* inst,NyLPC_TUInt16 i_hint,NyLPC_TUInt16* o_len,NyLPC_TUInt32 i_to);
\r
42 NyLPC_TBool NyLPC_cTcpSocket_psend(void* inst,void* i_buf,NyLPC_TUInt16 i_len,NyLPC_TUInt32 i_to);
\r
43 NyLPC_TInt32 NyLPC_cTcpSocket_precv(void* i_inst,const void** o_buf_ptr,NyLPC_TUInt32 i_wait_msec);
\r
44 void NyLPC_cTcpSocket_pseek(void* i_inst,NyLPC_TUInt16 i_seek);
\r
48 #endif /* __cplusplus */
\r
51 #include "../uip/NyLPC_cTcpSocket.h"
\r
56 #endif /* __cplusplus */
\r
59 * HttpStreamを供給するためのクラスです。このクラスは、NyLPC_TiHttpPtrStream_TInterfaceインタフェイスを実装します。
\r
61 typedef struct NyLPC_TcHttpStream NyLPC_TcHttpStream_t;
\r
65 struct NyLPC_TcHttpStream
\r
67 NyLPC_TiHttpPtrStream_t super;
\r
68 NyLPC_TcTcpSocket_t* _ref_sock;
\r
69 NyLPC_TUInt8* txb;//送信バッファ
\r
70 NyLPC_TUInt16 txb_size;//送信バッファサイズ
\r
71 NyLPC_TUInt16 tx_len; //送信サイズ
\r
72 NyLPC_TiHttpPtrStream_ET re_type;
\r
73 NyLPC_TiHttpPtrStream_ET we_type;
\r
79 * 接続済のソケットをストリームに抽象化します。
\r
80 * このインスタンスは、NyLPC_TiHttpPtrStream_TInterfaceインタフェイスを提供します。
\r
83 NyLPC_TBool NyLPC_cHttpStream_initialize(NyLPC_TcHttpStream_t* i_inst,NyLPC_TcTcpSocket_t* i_ref_sock);
\r
85 void NyLPC_cHttpStream_finalize(NyLPC_TcHttpStream_t* i_inst);
\r
89 #endif /* __cplusplus */
\r