28 lines
911 B
C
28 lines
911 B
C
|
/*
|
||
|
* circbuf.h
|
||
|
*/
|
||
|
|
||
|
|
||
|
/* Structure to manage the circular input buffer.
|
||
|
*/
|
||
|
typedef struct circularBuffer_tag
|
||
|
{
|
||
|
HANDLE hSelf; /* handle to this structure */
|
||
|
HANDLE hBuffer; /* buffer handle */
|
||
|
WORD wError; /* error flags */
|
||
|
DWORD dwSize; /* buffer size (in EVENTS) */
|
||
|
DWORD dwCount; /* byte count (in EVENTS) */
|
||
|
LPEVENT lpStart; /* ptr to start of buffer */
|
||
|
LPEVENT lpEnd; /* ptr to end of buffer (last byte + 1) */
|
||
|
LPEVENT lpHead; /* ptr to head (next location to fill) */
|
||
|
LPEVENT lpTail; /* ptr to tail (next location to empty) */
|
||
|
} CIRCULARBUFFER;
|
||
|
typedef CIRCULARBUFFER FAR *LPCIRCULARBUFFER;
|
||
|
|
||
|
|
||
|
/* Function prototypes
|
||
|
*/
|
||
|
LPCIRCULARBUFFER AllocCircularBuffer(DWORD dwSize);
|
||
|
void FreeCircularBuffer(LPCIRCULARBUFFER lpBuf);
|
||
|
WORD FAR PASCAL GetEvent(LPCIRCULARBUFFER lpBuf, LPEVENT lpEvent);
|