Function rbuffer_inject

Function Documentation

status_t rbuffer_inject(struct rbuffer *rb, void (*f)(void *elt, void *res), void *result)

Compute a cumulative SOMETHING using elements in the ringbuffer.

Parameters:
  • rb – The ringbuffer handle.

  • f – The mapping function, which CAN modify elements. First argument will point to each element in the ringbuffer in sequence. Second argument is result.

  • result – The initial result, which is passed to the callback along with each element in the ringbuffer.

Returns:

status_t.