libosmocore 0.9.6-23.20170220git32ee5af8.fc42
Osmocom core library
Loading...
Searching...
No Matches
strrb.c File Reference

Lossy string ringbuffer for logging; keeps newest messages. More...

#include <stdio.h>
#include <string.h>
#include <osmocom/core/strrb.h>

Functions

struct osmo_strrbosmo_strrb_create (TALLOC_CTX *ctx, size_t rb_size)
 Create an empty, initialized osmo_strrb.
 
bool osmo_strrb_is_empty (const struct osmo_strrb *rb)
 Check if an osmo_strrb is empty.
 
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.
 
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.
 
int osmo_strrb_add (struct osmo_strrb *rb, const char *data)
 Add a string to the osmo_strrb.
 

Detailed Description

Lossy string ringbuffer for logging; keeps newest messages.