function lfds710_ringbuffer_read

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds710
    ├───inc
    │   └───liblfds710
    │           lfds710_ringbuffer.h
    └───src
        └───lfds710_ringbuffer
                lfds710_ringbuffer_read.c

Opaque Structures

struct lfds710_ringbuffer_state;

Prototype

int lfds710_ringbuffer_read( struct lfds710_ringbuffer_state *rs,
                             void **key,
                             void **value );

Parameters

struct lfds710_ringbuffer_state *rs

A pointer to an initialized struct lfds710_ringbuffer_state.

void **key

Set to the value of the key in the current read element. This argument can be NULL, in which case it is not used (and so the caller cannot know the key).

void **value

Set to the value of the value in the current read element. This argument can be NULL, in which case it is not used (and so the caller cannot know the value).

Return Value

This function returns 1 on successful read, 0 if the ringbuffer has no unread elements.

Notes

Reads the oldest unread element in the ringbuffer. This element, which is to say the key and value in the element, is read by and only by one reader.

See Also