Searched refs:rb (Results 1 – 3 of 3) sorted by relevance
/system/bt/osi/src/ |
D | ringbuffer.c | 43 void ringbuffer_free(ringbuffer_t *rb) { in ringbuffer_free() argument 44 if (rb != NULL) in ringbuffer_free() 45 osi_free(rb->base); in ringbuffer_free() 46 osi_free(rb); in ringbuffer_free() 49 size_t ringbuffer_available(const ringbuffer_t *rb) { in ringbuffer_available() argument 50 assert(rb); in ringbuffer_available() 51 return rb->available; in ringbuffer_available() 54 size_t ringbuffer_size(const ringbuffer_t *rb) { in ringbuffer_size() argument 55 assert(rb); in ringbuffer_size() 56 return rb->total - rb->available; in ringbuffer_size() [all …]
|
/system/bt/osi/test/ |
D | ringbuffer_test.cpp | 9 ringbuffer_t *rb = ringbuffer_init(4096); in TEST() local 10 ASSERT_TRUE(rb != NULL); in TEST() 11 EXPECT_EQ((size_t)4096, ringbuffer_available(rb)); in TEST() 12 EXPECT_EQ((size_t)0, ringbuffer_size(rb)); in TEST() 13 ringbuffer_free(rb); in TEST() 17 ringbuffer_t *rb = ringbuffer_init(16); in TEST() local 20 ringbuffer_insert(rb, buffer, 10); in TEST() 21 EXPECT_EQ((size_t)10, ringbuffer_size(rb)); in TEST() 22 EXPECT_EQ((size_t)6, ringbuffer_available(rb)); in TEST() 25 size_t peeked = ringbuffer_peek(rb, 0, peek, 10); in TEST() [all …]
|
/system/bt/osi/include/ |
D | ringbuffer.h | 37 void ringbuffer_free(ringbuffer_t *rb); 40 size_t ringbuffer_available(const ringbuffer_t *rb); 43 size_t ringbuffer_size(const ringbuffer_t *rb); 48 size_t ringbuffer_insert(ringbuffer_t *rb, const uint8_t *p, size_t length); 54 size_t ringbuffer_peek(const ringbuffer_t *rb, off_t offset, uint8_t *p, size_t length); 57 size_t ringbuffer_pop(ringbuffer_t *rb, uint8_t *p, size_t length); 61 size_t ringbuffer_delete(ringbuffer_t *rb, size_t length);
|