libosmocore 1.10.0.57-8972
Osmocom core library
|
Ringbuffer implementation, tailored for logging. More...
#include <stdio.h>
#include <string.h>
#include <osmocom/core/strrb.h>
#include <osmocom/core/talloc.h>
Functions | |
struct osmo_strrb * | osmo_strrb_create (void *talloc_ctx, size_t rb_size) |
Create an empty, initialized osmo_strrb. More... | |
bool | osmo_strrb_is_empty (const struct osmo_strrb *rb) |
Check if an osmo_strrb is empty. More... | |
const char * | osmo_strrb_get_nth (const struct osmo_strrb *rb, unsigned int string_index) |
Return a pointer to the Nth string in the osmo_strrb. More... | |
bool | _osmo_strrb_is_bufindex_valid (const struct osmo_strrb *rb, unsigned int bufi) |
size_t | osmo_strrb_elements (const struct osmo_strrb *rb) |
Count the number of log messages in an osmo_strrb. More... | |
int | osmo_strrb_add (struct osmo_strrb *rb, const char *data) |
Add a string to the osmo_strrb. More... | |
Ringbuffer implementation, tailored for logging.
This is a lossy ringbuffer. It keeps up to N of the newest messages, overwriting the oldest as newer ones come in.
Ringbuffer assumptions, invarients, and notes: