function lfds711_ringbuffer_read

From liblfds.org
Jump to navigation Jump to search

Source Files

└───liblfds711
    ├───inc
    │   └───liblfds711
    │           lfds711_ringbuffer.h
    └───src
        └───lfds711_ringbuffer
                lfds711_ringbuffer_read.c

Opaque Structures

struct lfds711_ringbuffer_state;

Prototype

int lfds711_ringbuffer_read( struct lfds711_ringbuffer_state *rs,
                             void **key,
                             void **value );

Parameters

struct lfds711_ringbuffer_state *rs

A pointer to an initialized struct lfds711_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