gbuffer_getline()

gbuffer_getline()#

gbuffer_getline() retrieves a line from the given gbuffer_t up to the specified separator character, replacing it with a null terminator.

Prototype

char *gbuffer_getline(
    gbuffer_t *gbuf,
    char       separator
);

Parameters

Key

Type

Description

gbuf

gbuffer_t *

Pointer to the gbuffer_t instance from which the line is extracted.

separator

char

Character that marks the end of the line.


Return Value

Returns a pointer to the beginning of the extracted line within the buffer, or NULL if no more characters are available.

Notes

The function modifies the buffer by replacing the separator with a null terminator. It does not allocate new memory.

Prototype

// Not applicable in JS

Prototype

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