gbuffer_getchar()

gbuffer_getchar()#

gbuffer_getchar() retrieves and removes a single byte from the given gbuffer_t instance, advancing the read pointer.

Prototype

char gbuffer_getchar(
    gbuffer_t *gbuf
);

Parameters

Key

Type

Description

gbuf

gbuffer_t *

Pointer to the gbuffer_t instance from which a byte will be retrieved.


Return Value

Returns the retrieved byte if available; otherwise, returns 0 if no data remains.

Notes

Ensure that gbuffer_leftbytes(gbuf) is greater than zero before calling gbuffer_getchar() to avoid retrieving an invalid byte.

Prototype

// Not applicable in JS

Prototype

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