Lines Matching refs:buffer

43  * A circular buffer.
50 * Total buffer capacity.
55 * Amount of data in buffer.
73 * Creates a circular buffer of the specified capacity.
75 * @param capacity the capacity in number of bytes of the data buffer.
77 * @param buffer The circular buffer to initialize.
79 ESR_SHARED_API ESR_ReturnCode CircularBufferCreate(size_t capacity, const LCHAR* mtag, CircularBuffer** buffer);
82 * Returns the capacity of the buffer.
84 #define CircularBufferGetCapacity(buffer) ((buffer)->capacity + 0)
87 * Returns the current size (number of bytes) in the buffer.
89 #define CircularBufferGetSize(buffer) ((buffer)->size + 0)
92 * Returns whether buffer is empty or not.
94 #define CircularBufferIsEmpty(buffer) ((buffer)->size == 0)
97 * Returns whether buffer is full or not.
99 #define CircularBufferIsFull(buffer) ((buffer)->size == (buffer)->capacity)
102 * Resets the buffer to the empty state.
104 #define CircularBufferReset(buffer) ((buffer)->size = \
105 (buffer)->readIdx = \
106 (buffer)->writeIdx = 0)
109 * Determines the residual capacity of the circular buffer.
111 #define CircularBufferGetAvailable(buffer) ((buffer)->capacity - (buffer)->size)
114 * Reads requested number of bytes from the circular buffer.
116 * @param buffer The circular buffer to read from.
118 * @param bufSize The number of bytes to read from the circular buffer.
121 * error, while a value less than bufSize indicates that end-of-buffer is
124 ESR_SHARED_API int CircularBufferRead(CircularBuffer* buffer, void* data, size_t bufSize);
127 * Skips requested number of bytes from the circular buffer.
129 * @param buffer The circular buffer to skip from.
130 * @param bufSize The number of bytes to skip from the circular buffer.
133 * error, while a value less than bufSize indicates that end-of-buffer is
136 ESR_SHARED_API int CircularBufferSkip(CircularBuffer* buffer, size_t bufSize);
139 * Writes requested number of bytes from the circular buffer.
141 * @param buffer The circular buffer to write to
143 * @param bufSize The number of bytes to write into the circular buffer.
146 * an error, while a value less than bufSize indicates that buffer capacity is
149 ESR_SHARED_API int CircularBufferWrite(CircularBuffer* buffer, const void* data, size_t bufSize);
152 * Removes the requested number of bytes from the end of the circular buffer.
154 * @param buffer The circular buffer to write to
155 * @param amoun tThe number of bytes to remove from end of circular buffer.
160 ESR_SHARED_API int CircularBufferUnwrite(CircularBuffer* buffer, size_t amount);