istream_create()
#
The istream_create
function initializes and allocates an istream
instance. This instance provides an input stream buffer (gbuffer_t
) with specified sizes for handling data efficiently.
Prototype
PUBLIC istream_h istream_create(
hgobj gobj,
size_t data_size,
size_t max_size
);
Parameters
Parameter |
Type |
Description |
---|---|---|
|
The GObj associated with the input stream. |
|
|
|
The initial size of the data buffer. |
|
|
The maximum allowable size of the buffer. |
Return Value
Returns an istream_h
handle to the created istream.
If memory allocation fails, the function returns NULL
.
Notes
The function allocates memory for the
ISTREAM
structure and initializes its internal attributes, including agbuffer_t
for data storage.If the memory allocation for the buffer fails, the function cleans up and returns
NULL
.Ensure to free the allocated istream using
istream_destroy
when it is no longer needed to avoid memory leaks.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples