Libtrap: Internal development docs
0.11.7
|
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_block_lock | ( | tb_block_t * | bl | ) |
Lock block before manipulation.
[in] | bl | Pointer to the TRAP buffer. |
Definition at line 222 of file trap_buffer.c.
int tb_block_unlock | ( | tb_block_t * | bl | ) |
Unlock block after manipulation.
Definition at line 227 of file trap_buffer.c.
void tb_destroy | ( | trap_buffer_t ** | tb | ) |
Free memory and set the pointer to NULL.
[in] | tb | Pointer to the TRAP buffer. |
Definition at line 191 of file trap_buffer.c.
trap_buffer_t* tb_init | ( | uint16_t | nblocks, |
uint32_t | blocksize | ||
) |
Create a new buffer that will work wit nblocks of block_size.
[in] | nblocks | Number of blocks that will be stored in the ring buffer. |
[in] | blocksize | Maximal size of each block. |
Definition at line 146 of file trap_buffer.c.
int tb_isblockfree | ( | tb_block_t * | bl | ) |
Check if the current block is free.
[in] | bl | Pointer to the block. |
Definition at line 137 of file trap_buffer.c.
int tb_lock | ( | trap_buffer_t * | tb | ) |
Lock buffer before manipulation.
[in] | tb | Pointer to the TRAP buffer. |
Definition at line 212 of file trap_buffer.c.
int tb_unlock | ( | trap_buffer_t * | tb | ) |
Unlock buffer after manipulation.
[in] | tb | Pointer to the TRAP buffer. |
Definition at line 217 of file trap_buffer.c.