Ruby 3.5.0dev (2025-09-16 revision 7dd9c76ad46af63f76e0df243f76a1720f54d50d)
|
A pm_buffer_t is a simple memory buffer that stores data in a contiguous block of memory. More...
#include <pm_buffer.h>
Public Member Functions | |
PRISM_EXPORTED_FUNCTION bool | pm_buffer_init (pm_buffer_t *buffer) |
Initialize a pm_buffer_t with its default values. | |
PRISM_EXPORTED_FUNCTION char * | pm_buffer_value (const pm_buffer_t *buffer) |
Return the value of the buffer. | |
PRISM_EXPORTED_FUNCTION size_t | pm_buffer_length (const pm_buffer_t *buffer) |
Return the length of the buffer. | |
PRISM_EXPORTED_FUNCTION void | pm_buffer_free (pm_buffer_t *buffer) |
Free the memory associated with the buffer. | |
Data Fields | |
size_t | length |
The length of the buffer in bytes. | |
size_t | capacity |
The capacity of the buffer in bytes that has been allocated. | |
char * | value |
A pointer to the start of the buffer. | |
A pm_buffer_t is a simple memory buffer that stores data in a contiguous block of memory.
Definition at line 22 of file pm_buffer.h.
PRISM_EXPORTED_FUNCTION void pm_buffer_free | ( | pm_buffer_t * | buffer | ) |
Free the memory associated with the buffer.
buffer | The buffer to free. |
Definition at line 355 of file pm_buffer.c.
PRISM_EXPORTED_FUNCTION bool pm_buffer_init | ( | pm_buffer_t * | buffer | ) |
Initialize a pm_buffer_t with its default values.
buffer | The buffer to initialize. |
Definition at line 27 of file pm_buffer.c.
PRISM_EXPORTED_FUNCTION size_t pm_buffer_length | ( | const pm_buffer_t * | buffer | ) |
Return the length of the buffer.
buffer | The buffer to get the length of. |
Definition at line 43 of file pm_buffer.c.
PRISM_EXPORTED_FUNCTION char * pm_buffer_value | ( | const pm_buffer_t * | buffer | ) |
Return the value of the buffer.
buffer | The buffer to get the value of. |
Definition at line 35 of file pm_buffer.c.
size_t pm_buffer_t::capacity |
The capacity of the buffer in bytes that has been allocated.
Definition at line 27 of file pm_buffer.h.
Referenced by pm_buffer_init_capacity().
size_t pm_buffer_t::length |
The length of the buffer in bytes.
Definition at line 24 of file pm_buffer.h.
Referenced by pm_buffer_append_zeroes(), pm_buffer_clear(), pm_buffer_concat(), pm_buffer_index(), pm_buffer_init_capacity(), pm_buffer_insert(), pm_buffer_length(), pm_buffer_prepend_string(), pm_buffer_rstrip(), and pm_serialize_content().
char* pm_buffer_t::value |
A pointer to the start of the buffer.
Definition at line 30 of file pm_buffer.h.
Referenced by pm_buffer_append_zeroes(), pm_buffer_concat(), pm_buffer_free(), pm_buffer_index(), pm_buffer_init_capacity(), pm_buffer_insert(), pm_buffer_prepend_string(), pm_buffer_rstrip(), pm_buffer_value(), and pm_serialize_content().