AoLoadConfig()

Updated: April 19, 2023

Load a configuration from a file and add its interfaces to the global list

Synopsis:

#include <aoi.h>

int32_t AoLoadConfig(const char *config_name, 
                     AOLoadedConfig_t **cfg);

Arguments:

config_name
The name of the configuration to load, or NULL to load the default configuration. See the function description for details about how this name maps to a pathname in the filesystem.
cfg
A pointer to a location for storing the address of an AOLoadedConfig_t structure to be written by the function. You should define this argument only if your application needs to load multiple configurations through the AOI library. The function will write metadata about the configuration being loaded, including the DLLs it contains and the hold counts for their controls, into the new structure. Later, you must pass this structure into AoUnloadConfig() to inform the library that you're no longer using this configuration.

This argument should be NULL if your application is loading only one configuration. In this case, you must manually release the controls and remove their interfaces.

Library:

libaoi.so

Description:

This function loads the configuration indicated by config_name. The configuration names the DLLs containing the interfaces that the application wants to use. The function adds these interfaces to the global list, and writes any interface settings into a structure at the location in cfg (if it's non-NULL).

In the config_name argument, you can name the configuration to load or provide NULL to use the default configuration. When this argument starts with a character that's not a slash, it's interpreted as the base name of the configuration file (i.e., the filename with no path or extension). If no matching file is found in the configuration directory, the library loads the default file. For information about how the library chooses the configuration directory, see the aoiconftool entry in the Utilities Reference.

When config_name starts with a slash (“/”), it's interpreted as a full path rather than a base name. Note that addon configuration files end must with the .conf extension. If the file can't be opened, the function fails without looking for a default file. This design lets an application try to load an explicitly named file and avoid implicitly loading the default file.

Returns:

0 if successful, -1 if an error occurred.

Classification:

QNX Neutrino