CPI_CircleBuffer.h
上传用户:tuheem
上传日期:2007-05-01
资源大小:21889k
文件大小:1k
- typedef void* CP_HCIRCLEBUFFER;
- typedef void (*pfn_CircleBufferUninitialise)(CP_HCIRCLEBUFFER bBuffer);
- //
- typedef void (*pfn_CircleBufferWrite)(CP_HCIRCLEBUFFER bBuffer, const void* pSourceBuffer, const unsigned int iNumBytes);
- typedef BOOL (*pfn_CircleBufferRead)(CP_HCIRCLEBUFFER bBuffer, void* pDestBuffer, const unsigned int iBytesToRead, unsigned int* pbBytesRead);
- typedef unsigned int (*pfn_CircleGetUsedSpace)(CP_HCIRCLEBUFFER bBuffer);
- typedef unsigned int (*pfn_CircleGetFreeSpace)(CP_HCIRCLEBUFFER bBuffer);
- typedef void (*pfn_CircleFlush)(CP_HCIRCLEBUFFER bBuffer);
- typedef void (*pfn_CircleSetComplete)(CP_HCIRCLEBUFFER bBuffer);
- typedef BOOL (*pfn_CircleIsComplete)(CP_HCIRCLEBUFFER bBuffer);
- //
- typedef struct _CPs_CircleBuffer
- {
- pfn_CircleBufferUninitialise Uninitialise;
- pfn_CircleBufferWrite Write;
- pfn_CircleBufferRead Read;
- pfn_CircleFlush Flush;
- pfn_CircleGetUsedSpace GetUsedSize;
- pfn_CircleGetFreeSpace GetFreeSize;
- pfn_CircleSetComplete SetComplete;
- pfn_CircleIsComplete IsComplete;
- BYTE* m_pBuffer;
- unsigned int m_iBufferSize;
- unsigned int m_iReadCursor;
- unsigned int m_iWriteCursor;
- HANDLE m_evtDataAvailable;
- CRITICAL_SECTION m_csCircleBuffer;
- BOOL m_bComplete;
- } CPs_CircleBuffer;
- //
- ////////////////////////////////////////////////////////////////////////////////
- CPs_CircleBuffer* CP_CreateCircleBuffer(const unsigned int iBufferSize);