gbuffer_serialize()

gbuffer_serialize()#

gbuffer_serialize() converts a gbuffer_t * into a JSON object, encoding its data in Base64 format.

Prototype

json_t *gbuffer_serialize(
    hgobj gobj,
    gbuffer_t *gbuf  // not owned
);

Parameters

Key

Type

Description

gobj

hgobj

The hgobj context for logging and error handling.

gbuf

gbuffer_t *

The gbuffer_t * to be serialized. The buffer is not modified or owned by the function.


Return Value

A JSON object containing the serialized gbuffer_t *, including its label, mark, and Base64-encoded data.

Notes

The function encodes the buffer’s data in Base64 format to ensure safe storage and transmission. The returned JSON object must be freed by the caller.

Prototype

// Not applicable in JS

Prototype

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