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

Helper and debugging functions. More...

Functions

DB_DEF db_buffer db_to_hex (db_buffer buf, bool uppercase)
 Create a hexadecimal representation of buffer contents.
 
DB_DEF db_buffer db_from_hex (const char *hex_string, size_t length)
 Create buffer from hexadecimal string.
 
DB_DEF void db_debug_print (db_buffer buf, const char *label)
 Print buffer information for debugging.
 

Detailed Description

Helper and debugging functions.

Function Documentation

◆ db_debug_print()

DB_DEF void db_debug_print ( db_buffer  buf,
const char *  label 
)

Print buffer information for debugging.

Parameters
bufBuffer to print (can be NULL)
labelOptional label for the output

◆ db_from_hex()

DB_DEF db_buffer db_from_hex ( const char *  hex_string,
size_t  length 
)

Create buffer from hexadecimal string.

Parameters
hex_stringHexadecimal string (must be valid hex)
lengthLength of hex string
Returns
New buffer containing decoded bytes, or NULL on invalid hex string (asserts on allocation failure)

◆ db_to_hex()

DB_DEF db_buffer db_to_hex ( db_buffer  buf,
bool  uppercase 
)

Create a hexadecimal representation of buffer contents.

Parameters
bufBuffer to convert (must not be NULL)
uppercaseUse uppercase hex digits if true
Returns
New buffer containing hex string (asserts on allocation failure)