gbuffer_append()

gbuffer_append()#

Appends a specified number of bytes from a given buffer to the gbuffer_t structure, expanding its capacity if necessary.

Prototype

size_t gbuffer_append(
    gbuffer_t *gbuf,
    void      *bf,
    size_t     len
);

Parameters

Key

Type

Description

gbuf

gbuffer_t *

Pointer to the gbuffer_t structure where data will be appended.

bf

void *

Pointer to the buffer containing the data to append.

len

size_t

Number of bytes to append from bf.


Return Value

Returns the number of bytes successfully appended to the gbuffer_t.

Notes

If the gbuffer_t does not have enough space, it will attempt to reallocate memory. If reallocation fails, fewer bytes may be appended than requested.

Prototype

// Not applicable in JS

Prototype

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