Function rbuffer_index_query

Function Documentation

int rbuffer_index_query(struct rbuffer *rb, const void *e)

Get the index of an element in the ringbuffer.

If no element compare callback was passed during initialization, then calling this function is undefined.

Parameters:
  • rb – The ringbuffer handle.

  • e – The element to attempt to get the index of.

Returns:

The index of the first element in the rbuffer that matches according to the compare function, or -1 on error.