73VL_API vl_buffer*
vlBufferNewExt(vl_memsize_t size, vl_uint16_t align);
105VL_API
void vlBufferInitExt(vl_buffer* buffer, vl_memsize_t size, vl_uint16_t align);
119static inline void vlBufferInit(vl_buffer* buffer)
142VL_API
void vlBufferReset(vl_buffer* buffer, vl_memsize_t newCapacity);
216VL_API vl_buffer*
vlBufferClone(
const vl_buffer* src, vl_buffer* dest);
243VL_API vl_memsize_t
vlBufferCopy(vl_buffer* src, vl_buffer* dest, vl_memsize_t len);
272VL_API vl_memsize_t
vlBufferWrite(vl_buffer* buffer, vl_memsize_t size,
const void* src);
297VL_API vl_memsize_t
vlBufferRead(vl_buffer* buffer, vl_memsize_t size,
void* dest);
317static inline void vlBufferSeek(vl_buffer* buffer,
vl_uintptr_t offset) { buffer->offset = offset; }
338static inline void vlBufferSeekRelative(vl_buffer* buffer,
vl_intptr_t offset) { buffer->offset += offset; }
358static inline void vlBufferSeekBegin(vl_buffer* buffer) { buffer->offset = 0; }
379static inline void vlBufferSeekEnd(vl_buffer* buffer) { buffer->offset = buffer->size; }
399static inline vl_transient* vlBufferBegin(vl_buffer* buffer) {
return buffer->data; }
418static inline vl_transient* vlBufferEnd(vl_buffer* buffer) {
return buffer->data + buffer->size; }
VL_API void vlBufferClear(vl_buffer *buffer)
Sets the entirety of the buffer to zero. Also resets offset and computed size to zero.
Definition vl_buffer.c:33
VL_API void vlBufferReset(vl_buffer *buffer, vl_memsize_t newCapacity)
Resets the state of the specified buffer, setting the offset integer to zero and the computed size to...
Definition vl_buffer.c:26
VL_API void vlBufferInitExt(vl_buffer *buffer, vl_memsize_t size, vl_uint16_t align)
Initializes a buffer instance with specific size and alignment.
Definition vl_buffer.c:16
VL_API void vlBufferDelete(vl_buffer *buffer)
Deletes the specified buffer and its internal data.
Definition vl_buffer.c:108
VL_API vl_memsize_t vlBufferWrite(vl_buffer *buffer, vl_memsize_t size, const void *src)
Performs a copy from the specified source pointer into the buffer. The bytes are written at the curre...
Definition vl_buffer.c:80
VL_API vl_memsize_t vlBufferRead(vl_buffer *buffer, vl_memsize_t size, void *dest)
Copies bytes from the buffer to the specified destination. Performs a copy from the buffer to the spe...
Definition vl_buffer.c:98
VL_API void vlBufferShrinkToFit(vl_buffer *buffer)
Resizes the specified buffer to hold a capacity equal to the current computed size.
Definition vl_buffer.c:40
VL_API vl_memsize_t vlBufferCopy(vl_buffer *src, vl_buffer *dest, vl_memsize_t len)
Copies a series of bytes from one buffer to another.
Definition vl_buffer.c:72
VL_API vl_buffer * vlBufferClone(const vl_buffer *src, vl_buffer *dest)
Clones the source buffer to the destination buffer.
Definition vl_buffer.c:46
VL_API vl_buffer * vlBufferNewExt(vl_memsize_t size, vl_uint16_t align)
Allocates a new buffer, and initializes it with the specified capacity. The buffer must be deleted wi...
Definition vl_buffer.c:6
VL_API void vlBufferFree(vl_buffer *buffer)
Frees the internal data of the specified buffer.
Definition vl_buffer.c:114
#define VL_DEFAULT_MEMORY_ALIGN
Default memory alignment. Defaults to maximum system word size.
Definition vl_memory.h:60
#define VL_DEFAULT_MEMORY_SIZE
Default 1kb allocation size.
Definition vl_memory.h:46
VL_MEMORY_T vl_memory
Definition vl_memory.h:108
VL_MEMORY_T vl_transient
Definition vl_memory.h:118
VL_UPTR_T vl_uintptr_t
Unsigned integer type suitable for expressing memory addresses.
Definition vl_numtypes.h:163
VL_IPTR_T vl_intptr_t
Signed integer type suitable for expressing memory addresses.
Definition vl_numtypes.h:168
VL_STRUCTURE_OFFSET_T vl_dsoffs_t
Byte offset type for data structures.
Definition vl_numtypes.h:70