gbuffer_set_wr()

gbuffer_set_wr()#

Sets the write offset of the gbuffer_t structure, adjusting the position where new data will be written.

Prototype

int gbuffer_set_wr(
    gbuffer_t *gbuf,
    size_t     offset
);

Parameters

Key

Type

Description

gbuf

gbuffer_t *

Pointer to the gbuffer_t structure whose write offset is to be set.

offset

size_t

The new write offset position within the buffer.


Return Value

Returns 0 on success. Returns -1 if the specified offset exceeds the buffer size.

Notes

This function is useful when using gbuffer_t as a write buffer, allowing manual control over the write position.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples