macro ISTREAM_CREATE()

macro ISTREAM_CREATE()#

Macro to create an istream_h instance with specified buffer sizes, ensuring proper memory management and error handling.

Prototype

ISTREAM_CREATE(
    var,       istream_h *
    gobj,      hgobj
    data_size, size_t
    max_size,  size_t
)

Parameters

Key

Type

Description

var

istream_h *

Pointer to the istream_h instance to be created.

gobj

hgobj

Handle to the gobj that owns the istream.

data_size

size_t

Initial buffer size for the istream.

max_size

size_t

Maximum buffer size allowed for the istream.


Return Value

None. The macro initializes var with a new istream_h instance or destroys an existing one before reinitialization.

Notes

If var is already allocated, it is destroyed before creating a new instance. The macro logs an error if var is not NULL before reallocation.

Prototype

// Not applicable in JS

Prototype

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