2 #include "lfds700_ringbuffer_internal.h"
8 /****************************************************************************/
9 int lfds700_ringbuffer_read( struct lfds700_ringbuffer_state *rs,
12 struct lfds700_misc_prng_state *ps )
17 struct lfds700_queue_element
20 struct lfds700_ringbuffer_element
23 LFDS700_PAL_ASSERT( rs != NULL );
24 // TRD : key can be NULL
25 // TRD : value can be NULL
26 LFDS700_PAL_ASSERT( ps != NULL );
28 rv = lfds700_queue_dequeue( &rs->qs, &qe, ps );
32 re = LFDS700_QUEUE_GET_VALUE_FROM_ELEMENT( *qe );
33 re->qe_use = (struct lfds700_queue_element *) qe;
38 LFDS700_FREELIST_SET_VALUE_IN_ELEMENT( re->fe, re );
39 lfds700_freelist_push( &rs->fs, &re->fe, ps );