gbuffer_setlabel()

gbuffer_setlabel()#

Sets the label of the given gbuffer_t *. If a label already exists, it is freed before assigning the new one.

Prototype

int gbuffer_setlabel(
    gbuffer_t *gbuf,
    const char *label
);

Parameters

Key

Type

Description

gbuf

gbuffer_t *

Pointer to the gbuffer_t * whose label is to be set.

label

const char *

New label string to assign. If NULL, the existing label is removed.


Return Value

Returns 0 on success. If gbuf is NULL, an error is logged and -1 is returned.

Notes

If a label is already set, it is freed before assigning the new one. The function duplicates the input string to ensure memory safety.

Prototype

// Not applicable in JS

Prototype

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