AoFindName()

Updated: April 19, 2023

Find a control by its name

Synopsis:

#include <aoi.h>

const AOICtrl_t *AoFindName(const char *name,
                            const char *oiface,
                            int32_t version);

Arguments:

name
The name of the control you want to find, set in the control's Name interface.
oiface
The name of an interface that any returned control should contain, or NULL if you want to get the first control with a matching name from the global list.
version
The minimum version of the interface specified with the oiface argument; this is ignored if oiface is NULL.

Library:

libaoi.so

Description:

This function finds a control that has the given name and if specified, an interface that has the given interface name and version. Controls are named only if they declare the Name interface in their interfaces list. Before the function returns, it increments the hold counter for the control, which loads the DLL into memory if it was not already loaded (assuming the control represents a DLL).

Returns:

A pointer to an AOICtrl_t structure for a control that matches the search criteria, or NULL if no such control was found.

Example:

Here's an example of a Name interface declaration:

AOInterface_t pnm_idecoder_interface[] =
{
    { "Name", 0, "pnm_idecoder" },
    { "Description", 0, "PNM Image Reader" },
    ...
    { 0, 0, 0 },
};
If the above interfaces were added to the list of available interfaces, and you wanted to find the AOI control named pnm_idecoder, without specifying a particular interface that it must contain, you would write code like this:
AOICtrl_t *ctrl = AoFindName( "pnm_idecoder", NULL, 0 );
Now you can use the control to find specific interfaces.

Classification:

QNX Neutrino