ringbuffer.h
Go to the documentation of this file.
/***************************************************************************
$RCSfile$
-------------------
cvs : $Id$
begin : Sun Jan 25 2004
copyright : (C) 2004 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
* *
***************************************************************************/
#ifndef GWEN_RINGBUFFER_H
#define GWEN_RINGBUFFER_H
#include <gwenhywfar/types.h>
#include <gwenhywfar/gwenhywfarapi.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct GWEN_RINGBUFFER GWEN_RINGBUFFER;
GWENHYWFAR_API
GWEN_RINGBUFFER *GWEN_RingBuffer_new(unsigned int size);
GWENHYWFAR_API
void GWEN_RingBuffer_free(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
int GWEN_RingBuffer_WriteBytes(GWEN_RINGBUFFER *rb,
const char *buffer,
uint32_t *size);
GWENHYWFAR_API
int GWEN_RingBuffer_WriteByte(GWEN_RINGBUFFER *rb, char c);
GWENHYWFAR_API
int GWEN_RingBuffer_ReadBytes(GWEN_RINGBUFFER *rb,
char *buffer,
uint32_t *size);
GWENHYWFAR_API
int GWEN_RingBuffer_ReadByte(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t GWEN_RingBuffer_GetUsedBytes(const GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t GWEN_RingBuffer_GetBytesLeft(const GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t GWEN_RingBuffer_GetBufferSize(const GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t GWEN_RingBuffer_GetEmptyCounter(const GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
void GWEN_RingBuffer_ResetEmptyCounter(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t GWEN_RingBuffer_GetFullCounter(const GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
void GWEN_RingBuffer_ResetFullCounter(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t GWEN_RingBuffer_GetThroughput(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
void GWEN_RingBuffer_ResetThroughput(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t GWEN_RingBuffer_GetMaxUsedBytes(const GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
void GWEN_RingBuffer_ResetMaxUsedBytes(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
void GWEN_RingBuffer_Reset(GWEN_RINGBUFFER *rb);
/* name */
GWENHYWFAR_API
uint32_t
GWEN_RingBuffer_GetMaxUnsegmentedRead(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
uint32_t
GWEN_RingBuffer_GetMaxUnsegmentedWrite(GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
void GWEN_RingBuffer_SkipBytesRead(GWEN_RINGBUFFER *rb,
uint32_t psize);
GWENHYWFAR_API
void GWEN_RingBuffer_SkipBytesWrite(GWEN_RINGBUFFER *rb,
uint32_t psize);
GWENHYWFAR_API
const char *GWEN_RingBuffer_GetReadPointer(const GWEN_RINGBUFFER *rb);
GWENHYWFAR_API
char *GWEN_RingBuffer_GetWritePointer(const GWEN_RINGBUFFER *rb);
/* name */
/* group */
#ifdef __cplusplus
}
#endif
#endif /* GWEN_RINGBUFFER_H */
gwenhywfarapi.h
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWEN_RingBuffer_Reset
GWENHYWFAR_API void GWEN_RingBuffer_Reset(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetWritePointer
GWENHYWFAR_API char * GWEN_RingBuffer_GetWritePointer(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_WriteBytes
GWENHYWFAR_API int GWEN_RingBuffer_WriteBytes(GWEN_RINGBUFFER *rb, const char *buffer, uint32_t *size)
GWEN_RingBuffer_ResetFullCounter
GWENHYWFAR_API void GWEN_RingBuffer_ResetFullCounter(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_ResetEmptyCounter
GWENHYWFAR_API void GWEN_RingBuffer_ResetEmptyCounter(GWEN_RINGBUFFER *rb)
GWEN_RINGBUFFER
struct GWEN_RINGBUFFER GWEN_RINGBUFFER
Definition ringbuffer.h:48
GWEN_RingBuffer_GetMaxUnsegmentedRead
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetMaxUnsegmentedRead(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetUsedBytes
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetUsedBytes(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetBytesLeft
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetBytesLeft(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetFullCounter
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetFullCounter(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_WriteByte
GWENHYWFAR_API int GWEN_RingBuffer_WriteByte(GWEN_RINGBUFFER *rb, char c)
GWEN_RingBuffer_SkipBytesWrite
GWENHYWFAR_API void GWEN_RingBuffer_SkipBytesWrite(GWEN_RINGBUFFER *rb, uint32_t psize)
GWEN_RingBuffer_ReadBytes
GWENHYWFAR_API int GWEN_RingBuffer_ReadBytes(GWEN_RINGBUFFER *rb, char *buffer, uint32_t *size)
GWEN_RingBuffer_GetEmptyCounter
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetEmptyCounter(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_new
GWENHYWFAR_API GWEN_RINGBUFFER * GWEN_RingBuffer_new(unsigned int size)
GWEN_RingBuffer_ReadByte
GWENHYWFAR_API int GWEN_RingBuffer_ReadByte(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_SkipBytesRead
GWENHYWFAR_API void GWEN_RingBuffer_SkipBytesRead(GWEN_RINGBUFFER *rb, uint32_t psize)
GWEN_RingBuffer_GetReadPointer
GWENHYWFAR_API const char * GWEN_RingBuffer_GetReadPointer(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetBufferSize
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetBufferSize(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_ResetThroughput
GWENHYWFAR_API void GWEN_RingBuffer_ResetThroughput(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetThroughput
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetThroughput(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetMaxUsedBytes
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetMaxUsedBytes(const GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_ResetMaxUsedBytes
GWENHYWFAR_API void GWEN_RingBuffer_ResetMaxUsedBytes(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_GetMaxUnsegmentedWrite
GWENHYWFAR_API uint32_t GWEN_RingBuffer_GetMaxUnsegmentedWrite(GWEN_RINGBUFFER *rb)
GWEN_RingBuffer_free
GWENHYWFAR_API void GWEN_RingBuffer_free(GWEN_RINGBUFFER *rb)
types.h