OSDN Git Service

07f48b16d737cf40b15f5a9babbf090accd8ee1b
[mimic/MiMicSDK.git] / lib / src / http / NyLPC_cHttpStream.h
1 /*********************************************************************************\r
2  * PROJECT: MiMic\r
3  * --------------------------------------------------------------------------------\r
4  *\r
5  * This file is part of MiMic\r
6  * Copyright (C)2011 Ryo Iizuka\r
7  *\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
12  *\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
17  *\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
20  *\r
21  * For further information please contact.\r
22  *      http://nyatla.jp/\r
23  *      <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
24  *\r
25  *********************************************************************************/\r
26 #ifndef NyLPC_TcHttpStream_h\r
27 #define NyLPC_TcHttpStream_h\r
28 \r
29 #include "NyLPC_config.h"\r
30 #include "NyLPC_iHttpPtrStream.h"\r
31 \r
32 \r
33 \r
34 #if NyLPC_CONFIG_cHttpStream_DEBUG == 1\r
35 #ifdef __cplusplus\r
36 extern "C" {\r
37 #endif /* __cplusplus */\r
38 \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
45 \r
46 #ifdef __cplusplus\r
47 }\r
48 #endif /* __cplusplus */\r
49 \r
50 #else\r
51 #include "../uip/NyLPC_cTcpSocket.h"\r
52 #endif\r
53 \r
54 #ifdef __cplusplus\r
55 extern "C" {\r
56 #endif /* __cplusplus */\r
57 \r
58 /**\r
59  * HttpStreamを供給するためのクラスです。このクラスは、NyLPC_TiHttpPtrStream_TInterfaceインタフェイスを実装します。\r
60  */\r
61 typedef struct NyLPC_TcHttpStream NyLPC_TcHttpStream_t;\r
62 \r
63 \r
64 \r
65 struct NyLPC_TcHttpStream\r
66 {\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
74 };\r
75 \r
76 \r
77 \r
78 /**\r
79  * 接続済のソケットをストリームに抽象化します。\r
80  * このインスタンスは、NyLPC_TiHttpPtrStream_TInterfaceインタフェイスを提供します。\r
81  * @\r
82  */\r
83 NyLPC_TBool NyLPC_cHttpStream_initialize(NyLPC_TcHttpStream_t* i_inst,NyLPC_TcTcpSocket_t* i_ref_sock);\r
84 \r
85 void NyLPC_cHttpStream_finalize(NyLPC_TcHttpStream_t* i_inst);\r
86 \r
87 #ifdef __cplusplus\r
88 }\r
89 #endif /* __cplusplus */\r
90 \r
91 #endif\r