MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / pipe_pop

Function pipe_pop

src/utils/bluetooth/macos_third_party/pipe.c:1192–1208  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1190}
1191
1192size_t pipe_pop(pipe_consumer_t* p, void* target, size_t count)
1193{
1194 size_t elem_size = __pipe_elem_size(PIPIFY(p));
1195
1196 size_t bytes_left = count*elem_size;
1197 size_t bytes_popped = 0;
1198 size_t ret = -1;
1199
1200 do {
1201 ret = __pipe_pop(PIPIFY(p), target, bytes_left);
1202 target = (void*)((char*)target + ret);
1203 bytes_popped += ret;
1204 bytes_left -= ret;
1205 } while(ret != 0 && bytes_left);
1206
1207 return bytes_popped / elem_size;
1208}
1209
1210size_t pipe_pop_eager(pipe_consumer_t* p, void* target, size_t count)
1211{

Callers

nothing calls this directly

Calls 2

__pipe_elem_sizeFunction · 0.85
__pipe_popFunction · 0.85

Tested by

no test coverage detected