Write()

Updated: April 19, 2023

Synopsis:

#include <aoi.h>

int64_t (*Write)(void *ctx,
                 const void *buf,
                 int64_t num);

Arguments:

ctx
The context of the stream you want to write to.
buf
The buffer containing the data you want to write to the stream.
num
The number of bytes to be written to the stream (which should be the length of buf).

Description:

This function should write num bytes to the stream at the stream's current file position.

Returns:

The number of bytes succesfully written to the stream, or -1 if an error occurred.