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 #include "NyLPC_cPtrStream_protected.h"
\r
31 const struct NyLPC_TcPtrStream_TInterface NyLPC_TcPtrStream_Interface={
\r
32 NyLPC_cPtrStream_pread_func,
\r
33 NyLPC_cPtrStream_write_func,
\r
34 NyLPC_cPtrStream_pseek_func,
\r
35 NyLPC_cPtrStream_close_func
\r
39 NyLPC_TInt32 NyLPC_cPtrStream_pread_func(NyLPC_TcPtrStream_t* i_inst,const void** o_buf_ptr,NyLPC_TUInt32 i_wait_msec)
\r
47 NyLPC_TBool NyLPC_cPtrStream_write_func(NyLPC_TcPtrStream_t* i_inst,const void* i_data,NyLPC_TInt16 i_length,NyLPC_TUInt32 i_wait_msec)
\r
53 return NyLPC_TBool_FALSE;
\r
57 void NyLPC_cPtrStream_pseek_func(NyLPC_TcPtrStream_t* i_inst,NyLPC_TUInt16 i_seek)
\r
63 void NyLPC_cPtrStream_close_func(NyLPC_TcPtrStream_t* i_inst)
\r
72 NyLPC_TBool NyLPC_cPtrStream_writeln(NyLPC_TcPtrStream_t* i_inst,const void* i_data,NyLPC_TInt16 i_length,NyLPC_TUInt32 i_wait_msec)
\r
74 if(NyLPC_cPtrStream_write(i_inst,i_data,i_length,i_wait_msec)){
\r
75 if(NyLPC_cPtrStream_write(i_inst,"\r\n",2,i_wait_msec)){
\r
76 return NyLPC_TBool_TRUE;
\r
79 return NyLPC_TBool_FALSE;
\r
84 NyLPC_TBool NyLPC_cPtrStream_writeInt(NyLPC_TcPtrStream_t* i_inst,NyLPC_TInt32 i_val,NyLPC_TUInt32 i_wait_msec,NyLPC_TUInt32 i_base)
\r
87 itoa(i_val,v,i_base);
\r
88 if(NyLPC_cPtrStream_write(i_inst,v,strlen(v),i_wait_msec)){
\r
89 return NyLPC_TBool_TRUE;
\r
91 return NyLPC_TBool_FALSE;
\r