OpenSync Plugin Environment
[OpenSync Plugin Module]

The public API of the opensync environment. More...


Functions

OSYNC_EXPORT OSyncPluginEnv * osync_plugin_env_new (OSyncError **error)
 This will create a new opensync environment.
OSYNC_EXPORT OSyncPluginEnv * osync_plugin_env_ref (OSyncPluginEnv *env)
 Increases the reference counton an opensync plugin environment.
OSYNC_EXPORT void osync_plugin_env_unref (OSyncPluginEnv *env)
 Removes a reference to an OSyncPluginEnv.
OSYNC_EXPORT osync_bool osync_plugin_env_load (OSyncPluginEnv *env, const char *path, OSyncError **error)
 Loads the sync modules from a given directory.
OSYNC_EXPORT void osync_plugin_env_register_plugin (OSyncPluginEnv *env, OSyncPlugin *plugin)
 Register plugin to plugin environment.
OSYNC_EXPORT OSyncPlugin * osync_plugin_env_find_plugin (OSyncPluginEnv *env, const char *name)
 Finds the plugin with the given name.
OSYNC_EXPORT int osync_plugin_env_num_plugins (OSyncPluginEnv *env)
 Returns the number of loaded plugins.
OSYNC_EXPORT OSyncPlugin * osync_plugin_env_nth_plugin (OSyncPluginEnv *env, int nth)
 Returns pointer to nth plugin.


Detailed Description

The public API of the opensync environment.

Function Documentation

OSYNC_EXPORT OSyncPluginEnv* osync_plugin_env_new ( OSyncError **  error  ) 

This will create a new opensync environment.

The environment will hold all information about plugins, groups etc

Returns:
A pointer to a newly allocated environment. NULL on error.

Definition at line 31 of file opensync_plugin_env.c.

OSYNC_EXPORT OSyncPluginEnv* osync_plugin_env_ref ( OSyncPluginEnv *  env  ) 

Increases the reference counton an opensync plugin environment.

The reference count on the OSyncPluginEnv is incremented. When the reference is no longer needed it should be removed with osync_plugin_env_unref

Returns:
The environment passed in

Definition at line 48 of file opensync_plugin_env.c.

OSYNC_EXPORT void osync_plugin_env_unref ( OSyncPluginEnv *  env  ) 

Removes a reference to an OSyncPluginEnv.

Decrements the reference count on an osync plugin environment. If the reference count reaches zero the environment is freed and all resources are unreferenced

Parameters:
env Pointer to the environment to unreference

Definition at line 60 of file opensync_plugin_env.c.

OSYNC_EXPORT osync_bool osync_plugin_env_load ( OSyncPluginEnv *  env,
const char *  path,
OSyncError **  error 
)

Loads the sync modules from a given directory.

Loads all sync modules from a directory into a osync environment

Parameters:
env Pointer to a OSyncPluginEnv environment
path The path where to look for plugins
error Pointer to a error struct to return a error
Returns:
TRUE on success, FALSE otherwise

Definition at line 84 of file opensync_plugin_env.c.

OSYNC_EXPORT void osync_plugin_env_register_plugin ( OSyncPluginEnv *  env,
OSyncPlugin *  plugin 
)

Register plugin to plugin environment.

Parameters:
env Pointer to a plugin environment
plugin Pointer to plugin which should get added to environment

Definition at line 142 of file opensync_plugin_env.c.

OSYNC_EXPORT OSyncPlugin* osync_plugin_env_find_plugin ( OSyncPluginEnv *  env,
const char *  name 
)

Finds the plugin with the given name.

Finds the plugin with the given name

Parameters:
env Pointer to a OSyncPluginEnv environment
name The name to search for
Returns:
The plugin or NULL if not found

Definition at line 200 of file opensync_plugin_env.c.

OSYNC_EXPORT int osync_plugin_env_num_plugins ( OSyncPluginEnv *  env  ) 

Returns the number of loaded plugins.

Returns the number of loaded plugins. 0 if used before initialization

Parameters:
env Pointer to a OSyncPluginEnv environment
Returns:
Number of plugins

Definition at line 212 of file opensync_plugin_env.c.

OSYNC_EXPORT OSyncPlugin* osync_plugin_env_nth_plugin ( OSyncPluginEnv *  env,
int  nth 
)

Returns pointer to nth plugin.

Returns pointer to nth plugin

Parameters:
env Pointer to a OSyncPluginEnv environment
nth Which plugin to return
Returns:
Pointer to plugin

Definition at line 217 of file opensync_plugin_env.c.


Generated on Fri Feb 13 13:33:30 2009 for OpenSync by  doxygen 1.5.7.1