Libtrap: Internal development docs  0.11.7
Data Structures | Macros | Typedefs | Functions
trap_buffer.h File Reference

TRAP ring buffer data structure. More...

#include <pthread.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
Include dependency graph for trap_buffer.h:
This graph shows which files directly or indirectly include this file:

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_ttb_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)
 

Detailed Description

TRAP ring buffer data structure.

Author
Tomas Cejka cejka.nosp@m.t@ce.nosp@m.snet..nosp@m.cz
Date
2016

Definition in file trap_buffer.h.

Macro Definition Documentation

◆ TB_EMPTY

#define TB_EMPTY   4

Definition at line 57 of file trap_buffer.h.

◆ TB_ERROR

#define TB_ERROR   1

Definition at line 54 of file trap_buffer.h.

◆ TB_FULL

#define TB_FULL   2

Definition at line 55 of file trap_buffer.h.

◆ TB_SUCCESS

#define TB_SUCCESS   0

Definition at line 53 of file trap_buffer.h.

◆ TB_USED_NEWBLOCK

#define TB_USED_NEWBLOCK   3

Definition at line 56 of file trap_buffer.h.

Typedef Documentation

◆ tb_block_t

typedef struct tb_block_s tb_block_t

◆ trap_buffer_t

typedef struct trap_buffer_s trap_buffer_t