gbuffer_get()

gbuffer_get()#

gbuffer_get() extracts a specified number of bytes from the given gbuffer_t and returns a pointer to the extracted data.

Prototype

void *gbuffer_get(
    gbuffer_t *gbuf,
    size_t      len
);

Parameters

Key

Type

Description

gbuf

gbuffer_t *

Pointer to the gbuffer_t instance from which data will be extracted.

len

size_t

Number of bytes to extract from the buffer.


Return Value

Returns a pointer to the extracted data if len bytes are available; otherwise, returns NULL.

Notes

Ensure that len does not exceed the available data in gbuffer_t. If len is greater than the remaining bytes, the function returns NULL without modifying the buffer.

Prototype

// Not applicable in JS

Prototype

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