Libtrap: Internal development docs
0.11.7
|
TRAP ring buffer data structure. More...
#include <pthread.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
Go to the source code of this file.
Data Structures | |
struct | tb_block_data_s |
struct | tb_block_s |
struct | trap_buffer_s |
Macros | |
#define | TB_SUCCESS 0 |
#define | TB_ERROR 1 |
#define | TB_FULL 2 |
#define | TB_USED_NEWBLOCK 3 |
#define | TB_EMPTY 4 |
#define | TB_FLUSH_START(wrb, bl, res) |
#define | TB_FLUSH_END(rdb, bl, s) |
#define | TB_FILL_START(rdb, bl, res) |
#define | TB_FILL_END(rdb, bl, s) |
Typedefs | |
typedef struct tb_block_s | tb_block_t |
typedef struct trap_buffer_s | trap_buffer_t |
Functions | |
trap_buffer_t * | tb_init (uint16_t nblocks, uint32_t blocksize) |
void | tb_destroy (trap_buffer_t **tb) |
int | tb_lock (trap_buffer_t *tb) |
int | tb_unlock (trap_buffer_t *tb) |
int | tb_block_lock (tb_block_t *bl) |
int | tb_block_unlock (tb_block_t *bl) |
int | tb_isblockfree (tb_block_t *bl) |
int | tb_pushmess (trap_buffer_t *tb, const void *data, uint16_t size) |
int | tb_pushmess2 (trap_buffer_t *tb, const void *d1, uint16_t s1, const void *d2, uint16_t s2) |
void | tb_clear_unused (trap_buffer_t *tb) |
void | tb_next_wr_block (trap_buffer_t *tb) |
void | tb_first_wr_block (trap_buffer_t *tb) |
int | tb_getmess (trap_buffer_t *tb, const void **data, uint16_t *size) |
void | tb_first_rd_block (trap_buffer_t *tb) |
void | tb_next_rd_block (trap_buffer_t *tb) |
#define TB_EMPTY 4 |
Definition at line 57 of file trap_buffer.h.
#define TB_ERROR 1 |
Definition at line 54 of file trap_buffer.h.
#define TB_FULL 2 |
Definition at line 55 of file trap_buffer.h.
#define TB_SUCCESS 0 |
Definition at line 53 of file trap_buffer.h.
#define TB_USED_NEWBLOCK 3 |
Definition at line 56 of file trap_buffer.h.
typedef struct tb_block_s tb_block_t |
typedef struct trap_buffer_s trap_buffer_t |