gbuffer_chunk()

gbuffer_chunk()#

gbuffer_chunk() returns the number of bytes available for reading in the given gbuffer_t instance, ensuring that the returned value does not exceed the allocated buffer size.

Prototype

PUBLIC size_t gbuffer_chunk(gbuffer_t *gbuf);

Parameters

Key

Type

Description

gbuf

gbuffer_t *

Pointer to the gbuffer_t instance whose available read chunk size is to be determined.


Return Value

Returns the number of bytes available for reading, ensuring it does not exceed the allocated buffer size.

Notes

This function calculates the available data chunk by taking the minimum of the remaining unread bytes and the allocated buffer size.

Prototype

// Not applicable in JS

Prototype

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