2 * Hyper Operating System Application Framework
5 * @brief %jp{ストリームデータ用バッファクラス}
7 * Copyright (C) 2002-2007 by Project HOS
8 * http://sourceforge.jp/projects/hos/
13 #include "streambuf_local.h"
17 unsigned int StreamBuf_SendData(C_STREAMBUF *self, const void *pData, unsigned int uiSize)
19 void *pBuf; /* バッファアドレス */
20 unsigned int uiBufSize; /* バッファサイズ */
21 unsigned int uiSendSize = 0; /* 送信サイズ */
26 if ( (uiBufSize = StreamBuf_GetBuf(self, &pBuf)) <= 0 )
32 if ( uiBufSize > uiSize )
38 memcpy(pBuf, pData, uiBufSize);
41 StreamBuf_SendBuf(self, uiBufSize);
44 pData = (void *)((char *)pData + uiBufSize);
46 uiSendSize += uiBufSize;
47 } while ( uiSize > 0 );
50 return uiSendSize; /* 送信サイズを返す */