Updated: April 19, 2023

Find the first control that can open a stream to the given file for the given mode and context parameters


#include <aoi.h>

AOIStream_t * AoOpenStream(const char *name,
                           const char *mode,
                           const AOParam_t *params,
                           AOError_t *err);


The name of the file you want to access through a stream.
The mode for opening the file stream, one of:
  • rb — Read binary
  • wb — Write binary
A pointer to an array of AOParam_t structures specifying the context parameter settings to apply.
A pointer to space for storing an AOError_t structure that will hold any error information.



This function iterates through all available AOI controls that export an AOStreamer interface and returns a stream object from the first control that can open the specified file in the specified mode. If the AOStreamer interface version indicates that the interface supports context parameters, the AOI library tries to apply the context parameters given in params when opening the stream. If this fails, the library writes error information to the structure referenced by err.

When the function succeeds, the control field in the returned stream object references the control, which is held. When you call AoStreamClose() to close the stream, the library releases the control referenced by this field.


A pointer to an AOIStream_t structure representing the successfully opened stream, or NULL if the stream couldn't be opened in the requested mode by any control.


QNX Neutrino