dynamic_buffer.h v0.2.2
Reference-counted byte buffer library for efficient I/O operations
Loading...
Searching...
No Matches
Functions
Buffer Access

Functions for accessing buffer data and properties. More...

Functions

DB_DEF size_t db_size (db_buffer buf)
 Get current size of buffer in bytes.
 
DB_DEF size_t db_capacity (db_buffer buf)
 Get current capacity of buffer in bytes.
 
DB_DEF bool db_is_empty (db_buffer buf)
 Check if buffer is empty.
 
DB_DEF int db_refcount (db_buffer buf)
 Get current reference count.
 

Detailed Description

Functions for accessing buffer data and properties.

Function Documentation

◆ db_capacity()

DB_DEF size_t db_capacity ( db_buffer  buf)

Get current capacity of buffer in bytes.

Parameters
bufBuffer instance (must not be NULL)
Returns
Current capacity in bytes

◆ db_is_empty()

DB_DEF bool db_is_empty ( db_buffer  buf)

Check if buffer is empty.

Parameters
bufBuffer instance (must not be NULL)
Returns
true if buffer has no data, false otherwise

◆ db_refcount()

DB_DEF int db_refcount ( db_buffer  buf)

Get current reference count.

Parameters
bufBuffer instance (must not be NULL)
Returns
Current reference count

◆ db_size()

DB_DEF size_t db_size ( db_buffer  buf)

Get current size of buffer in bytes.

Parameters
bufBuffer instance (must not be NULL)
Returns
Current size in bytes