Table Of Contents

Previous topic

Plug-ins

Next topic

Plug-in Definition

Plug-in Manager

The Plug-in Manager provides methods for loading plug-ins that are then available to the Speect Engine and all other loaded plug-ins. Loaded plug-ins are chached for reuse.

Summary

s_pm_load_plugin Load a plug-in from the given path.
s_pm_get_plugin_path Get the full plug-in path from the given path.

Functions

SPlugin *s_pm_load_plugin(const char *path, s_erc *error)

Load a plug-in from the given path.

If the plug-in at the given path has already been loaded, then the plug-in library’s reference counter is increased and a pointer to the loaded library is set in the returned plug-in. This reduces the need for multiple redundant calls. If the given path does not include any path separators (just a file name) then the path is concatenated with the default plug-in path.

Parameters:
  • path

    The full path and name of the plug-in to load.

  • error

    Error code.

Return:

Pointer to the loaded plug-in.

Note:

The returned plug-in can be normally deleted with S_DELETE.

Thread safe.

char *s_pm_get_plugin_path(const char *path, s_erc *error)

Get the full plug-in path from the given path.

If the given path does not include any path separators (just a file name) then the path is concatenated with the default plug-in path.

Parameters:
  • path

    The plug-in file/path

  • error

    Error code.

Return:

The full plug-in path

Note:

The caller is responsible for the memory of the returned string.