Searched refs:rb (Results 1 – 3 of 3) sorted by relevance
/system/bt/osi/src/ |
D | ringbuffer.c | 50 void ringbuffer_free(ringbuffer_t *rb) { in ringbuffer_free() argument 51 if (rb != NULL) in ringbuffer_free() 52 osi_free(rb->base); in ringbuffer_free() 53 osi_free(rb); in ringbuffer_free() 56 size_t ringbuffer_available(const ringbuffer_t *rb) { in ringbuffer_available() argument 57 assert(rb); in ringbuffer_available() 58 return rb->available; in ringbuffer_available() 61 size_t ringbuffer_size(const ringbuffer_t *rb) { in ringbuffer_size() argument 62 assert(rb); in ringbuffer_size() 63 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(4096, ringbuffer_available(rb)); in TEST() 12 EXPECT_EQ(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(10, ringbuffer_size(rb)); in TEST() 22 EXPECT_EQ(6, ringbuffer_available(rb)); in TEST() 25 size_t peeked = ringbuffer_peek(rb, 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); 53 size_t ringbuffer_peek(const ringbuffer_t *rb, uint8_t *p, size_t length); 56 size_t ringbuffer_pop(ringbuffer_t *rb, uint8_t *p, size_t length); 60 size_t ringbuffer_delete(ringbuffer_t *rb, size_t length);
|